Friday, February 24, 2012

opens all profile locations


$a=(($profile | get-member -type noteproperty | % {$_.Definition}) -split("="))[1,3,5,7]
foreach ($i in $a) {notepad $i}

2 comments:

Shay Levy said...

Nice. You can get the locations without parsing strings. Also, one of the profile doesn't exist notepad throws an error.

$profile.psextended.psobject.properties | where {test-path $_.value} | foreach {notepad $_.value}

Ryan M. Ferris said...

Shay:
Thanks for this...I had some trouble with your syntax...but this worked:
$profile.psextended.psobject.properties | Select Value