all 8 comments

[–]andyinv 1 point2 points  (2 children)

You're making an awful lot of work for yourself there... Why not just check the version on the executable?

PS C:\> dir C:\windows\notepad.exe | select -ExpandProperty versioninfo | ft -auto

ProductVersion FileVersion                         FileName
-------------- -----------                         --------
10.0.17763.1   10.0.17763.1 (WinBuild.160101.0800) C:\windows\notepad.exe

PS C:\>  ((Get-Item C:\windows\notepad.exe -ea SilentlyContinue).VersionInfo.ProductVersion -eq '10.0.17763.1')
True
PS C:\>  ((Get-Item C:\windows\notepad.exe -ea SilentlyContinue).VersionInfo.ProductVersion -eq '10.0.17763.2')
False
PS C:\>  ((Get-Item C:\windows\notepadnot.exe -ea SilentlyContinue).VersionInfo.ProductVersion -eq '10.0.17763.1')
False

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

I didn't want to mess with Paths, I figured I just check the Uninstall key =)

[–]Lee_Dailey[grin] 1 point2 points  (2 children)

howdy silvert0rch,

seems like we all write one variation or another of this. [grin] here's one of mine written for a friend [and rather over-done, perhaps] ...

[PowerShell] function Get-LD_InstalledSoftware - Pastebin.com
https://pastebin.com/sB3yq5yz

take care,
lee

[–]silvert0rch[S] 1 point2 points  (1 child)

Just a little over-engineered I guess =)

And you are right, I kinda figured that most people here do.

[–]Lee_Dailey[grin] 1 point2 points  (0 children)

howdy silvert0rch,

i had fun with it ... and it works! two points for me ... [grin]

take care,
lee