2020-09-18 19:41:58 +00:00
|
|
|
[CmdletBinding()]param(
|
|
|
|
[switch]$AsDictionary
|
|
|
|
)
|
|
|
|
|
2022-01-29 21:35:26 +00:00
|
|
|
filter ConvertTo-Hash { param([string]$Property='Name') begin { $hash = @{} } process{ $hash[$_."$Property"] = $_ } end {return $hash} }
|
2020-09-18 19:41:58 +00:00
|
|
|
|
2022-01-29 21:35:26 +00:00
|
|
|
$local:rVal = $PROFILE | Get-Member -Type NoteProperty |
|
|
|
|
Select-Object -ExpandProperty Name |
|
|
|
|
Select-Object @{
|
|
|
|
N='Profile';E={$_}
|
|
|
|
},@{N='Path';E={$PROFILE."$_"}
|
|
|
|
} |
|
|
|
|
Select-Object *,@{N="Exists";E={Test-Path $_.Path}}
|
2020-09-18 19:41:58 +00:00
|
|
|
if( $AsDictionary ) { return $rVal | ConvertTo-Hash -Property "Profile" }
|
|
|
|
return $rVal
|