How do you create a custom inventory rule for figuring out a machine's Powershell Version?
01/23/2015 2582 views
ShellCommandtextReturn(%systemroot%\sysnative\windowspowershell\v1.0\powershell.exe $PSVersionTable.PSVersion | Select-String -pattern 4,4.0)
I only want to create a rule for Powershell version 4. So the idea i had was to get the version number from the $PSVersionTable. This returns an actual table and I really only want one number. So I used the Select-string -pattern of 4. In the powershell window on a computer, it returns 4.0. So the comma 4.0 at the end of the statement is supposed to match the output on the command but doesn't.
Be the first to answer this question