Skip to content

Instantly share code, notes, and snippets.

@gravejester
Last active August 29, 2015 14:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gravejester/e141f18fe85f62feeff3 to your computer and use it in GitHub Desktop.
Save gravejester/e141f18fe85f62feeff3 to your computer and use it in GitHub Desktop.
function Get-SpecialFolder {
param ([string]$Name)
foreach ($folder in (([Enum]::GetValues([System.Environment+SpecialFolder])) | Where-Object {$_ -like $Name})) {
Write-Output (,([PSCustomObject] @{
Name = $folder.ToString()
Path = [System.Environment]::GetFolderPath($folder)
}))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment