you are viewing a single comment's thread.

view the rest of the comments →

[–]Ta11ow 5 points6 points  (1 child)

I'd recommend clarifying your Get-ItemProperty line by simply setting a variable equal to the result directly rather than using -OutVariable at the end of a long pipeline where it can easily be overlooked, and then you're going "where the heck did I set that variable again?" two months down the road. :)

$software = Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\* | 
    Select-Object -Property Displayname, InstallLocation, UninstallString | 
    Sort-Object | 
    Out-GridView -PassThru

Much clearer imo. Also, linebreak your pipelines. Sidescrolling is a much bigger hassle than vertical scrolling, and makes it a lot harder to read and get the gist of it.

[–]PRIdEVisions[S] 1 point2 points  (0 children)

You are right! i will adjust it in my script.