Pass a parameter from BigFix into Powershell Native script

I have built a fixlet to disable local user accounts. You input the user ID to disable in a text box on the Description tab, then click the “Click here to deploy” to deploy the action. The User parameter does not seem to be getting passed into the powershell script, it is not being written to my log file.
image
image

I have tried about 300 different ways to try to get the parameter into powershell without any resolve. The script runs just fine if I manually enter the Username into the script itself. Any thoughts on how I can get that parameter to cary over to prevent having to edit the fixlet each time before it is ran?

There is no ability to process Relevance (like Parameter values) using the PowerShell script type.

Instead you’d need to change to the ActionScript action type. Then use the ‘createfile’ command to write the PowerShell script on the fly, and the ‘wait’ command to execute it.

When writing the PowerShell file, be sure to escape the open-cirly symbol { as {{, to prevent Relevance substitutions where you don’t want them. Only the Relevance substitutions should begin with a single open-bracket.

2 Likes

Sorry it took me a bit to find it, but if you’re going to be updating PowerShell-based actions regularly, you may want to check out the custom dashboards at content/dashboards at master · bigfix/content · GitHub

The “Script Task Builder” dashboard allows you to paste in PowerShell (or Batch, or UNIX Shell script) and wraps the script into a BigFix ActionScript type. It handles escaping the { and } characters as needed, and configures common launch commands (like running in native x64 mode, and bypassing ExecutionPolicy).

You could take the tasks/fixlets generated by the wizard and then add your parameters.