Hi Kevin, are you saying you are looking in these locations and none of them have the right info for your devices? :
Software - Package
Software - Add or Remove
Software - Product
I'm having a hard time getting a query to accurately tell me the version of powershell installed on a system.
How are you writing your query?
When I look at inventory under the Software - Package section, there are numerous entries for powershell.exe since it is in a number of directories. For query purposes, I think you want to query on the path = "C:\WINDOWS\SYSWOW64\WINDOWSPOWERSHELL\V1.0\POWERSHELL.EXE" or "C:\WINDOWS\SYSTEM32\WINDOWSPOWERSHELL\V1.0\POWERSHELL.EXE". Then select "Product Version" as one of the columns to be displayed.
That should return what you are looking for.
2 of 2 people found this helpful
We use a registry detection method by adding the PowerShell RunTimeVersion key value to Custom Data | Registry Items and then querying on that. Unfortunately there are 2 keys, one for v1/v2 and another for v3/v4, but you can add both.
This old article pointed me in the right direction - Detection logic for PowerShell installation - Windows PowerShell Blog - Site Home - MSDN Blogs
So you need to add both of these to capture v1-4:
HKLM:\software\Microsoft\powershell\1\PowerShellEngine - RunTimeVersion (for v1/v2)
HKLM:\software\Microsoft\powershell\3\PowerShellEngine - RunTimeVersion (for v3/v4)
Once you've made the changes available to clients from Reporting/Monitoring | Manage Software List , you can then query on these registry keys.
Results then look like this:
You can probably make it look more 'purdy', but this does us just fine.
Thanks for the info. I'll give that a try.
You can also just run a mini powershell script which coughs out that data to you & you can do with it what you want.
The thing you want to call / check would be usually:
for instance - which would return "4" if you have Powershell 4 installed.
... depends on whether you want to pull the info from within powershell itself or not. Plenty of ways to skin that particular cat .