This morning I was scheduled to install some software, one part of HP Service Pack was not installed, so I made the decision to just install that component, rather then re-running that Service Pack Setup (HPSUM). The quarion is, what file contains what I need? All files has just the CPXXXXXXX.exe? If I select properties from a file in explorer, I can see that it contains this:
Hmm, how could I get that using PowerShell? Could it be “"Get-ChildItem”?
Running Get-ChildItem -Path \\cloud\dfs\Software\Applications\HP\swpackages -Filter *.exe gives me this:
and that does not help, but if adding | Select * will give me this:
So, the info is there, right, now how could I get rid of the junk…
Hmm, there is something called VersionInfo, lets try that…
Get-ChildItem -Path \\cloud\dfs\Software\Applications\HP\swpackages -Filter *.exe | Select-Object Name,VersionInfo | Out-GridView
Getting closer, bet still to much junk…
Maybe, this would work?
Get-ChildItem -Path \\cloud\dfs\Software\Applications\HP\swpackages -Filter *.exe | Select-Object -ExpandProperty VersionInfo | Select-Object -Property ProductName, ProductVersion, Filename | Out-GridView
Lets try that:
Yes, that seems to give the the result I like.
/mike
Categories: PowerShell
Reblogged this on MDTGuy.WordPress.com and commented:
Another excellent post from Mikael!