This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
howdy y'all,
got curious about "Special Folders" and decided to write a function to grab the info. so, it works, but i have a few questions [not counting the placeholder CBH [grin]] ...
[1] what did i leave out/do wrong/do less than optimally?
[2] should i deal with using both the switches?
right now it takes both and only responds to the 1st in the switch block. i suspect i otta make them exclusive somehow.
[decided to go with a three-value selector instead of two switches.]
[3] is there any graceful way to return only the user items?
checking for the username won't always work. i redirected my docs & music to D:\Data\*
, so that won't do the job for my setup.
[4] should i short-circuit the $WhatToReturn
decision?
the current switch is very clear, but it requires building the $TempObject
for each item. that could be sidestepped for NameOnly
& PathOnly
by returning that info instead building the $TempObject
.
i don't think it would save enuf time to make it worth the lessened clarity, tho. [frown]
original version ...
[PowerShell] function Get-SpecialFolderInfo - 2018.01.19.18.48.11 - Pastebin.com
— https://pastebin.com/XZC0BXWJ
current version ...
[PowerShell] function Get-SpecialFolderInfo - 2018.01.20.15.54.11 - Pastebin.com
— https://pastebin.com/UXn6fPrZ
take care,
lee
Subreddit
Post Details
- Posted
- 6 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/PowerShell/...