As a note, one of the features we introduced with BigFix 10.0.4 is native Powershell support to help simplify its use and avoid these types of challenges.
Here’s also a brief video if interested in a demo: https://www.youtube.com/watch?v=UT1hls4QWKQ
And additional reference: https://help.hcltechsw.com/bigfix/10.0/platform/Platform/Console/Dialogs/action_script_tab.html