TROUBLESHOOTING: Test PowerShell - Windows
Log In or Register to download the BES file, and more.

0 Votes

Versioning - This is the latest version.

1TROUBLESHOOTING: Test PowerShell - Windows4/8/2015 1:34:26 PM
2TROUBLESHOOTING: Test PowerShell - Windows4/8/2015 1:43:30 PM


This task will test the execution of a powershell command through BigFix on the target system. The powershell version will be reported as the exit code of the action.

See a related analysis here:


Property Details

StatusBeta - Preliminary testing ready for more
TitleTROUBLESHOOTING: Test PowerShell - Windows
Source Release Date4/8/2015 12:00:00 AM
Added by on 4/8/2015 1:43:30 PM
Last Modified by on 4/8/2015 1:43:30 PM
Counters 2545 Views / 23 Downloads
User Rating 1 star 2 star 3 star 4 star 5 star * Average over 0 ratings. ** Log In or Register to add your rating.


isWindows (Relevance 1172)
Used in 1070 fixlets and 522 analyses   * Results in a true/false
Show indented relevance
windows of operating system


Action 1 (default)

Action Link Click here to deploy this action.
Script Type BigFix Action Script
delete C:\windows\temp\bigfix_test_powershell.txt

waithidden powershell -ExecutionPolicy Bypass -command "Get-Host | out-file C:\windows\temp\bigfix_test_powershell.txt"

continue if{ exists (it) whose(it as lowercase starts with "name") of (concatenation of characters whose (it != "%00") of it) whose(it as trimmed string != "") of lines of files "C:\windows\temp\bigfix_test_powershell.txt" }

// The exit code is the major version of powershell or -1 if it cannot find the version #
exit { (unique value of (it as integer) of preceding texts of firsts "." of (it as string) of pads of (it as trimmed string as version) of following texts of firsts ":" of (it) whose(it as lowercase starts with "version") of (concatenation of characters whose (it != "%00") of it) whose(it as trimmed string != "") of lines of files "C:\windows\temp\bigfix_test_powershell.txt") | -1 }
Success Criteria

This action will be considered successful when the applicability relevance evaluates to false.


Social Media:
Share this page on Yammer


Log In or Register to leave comments!
jgstew -
$psversiontable.psversion might be the better option anyway actually
kjmccann1 -
To return the version directly as an exit code and without needing to write and read a text files: waithidden powershell -ExecutionPolicy Bypass -command "exit $psversiontable.psversion.Major.ToString()" parameter "psversion"="{if exist exit code of action then exit code of action as string else "-1"}" exit {parameter "psversion"}