Test Scripts
You can evaluate a script on a test asset before you execute it on production assets. This step is optional; however, it is recommended to test a script to avoid any failure in the production environment.
Testing can be done before or after a script is reviewed and approved.
To know more about reviewing a script, refer to Review.
To execute a selected script on test assets, follow these steps:
- Navigate to the Scripts tab.
- Select a script and click Test Script from the Quick Actions menu.
The Test Script option is disabled if the script is deprecated or rejected.
-
Click
on the Add Assets section to select the lab assets.
When testing a parameterized script, you can modify the Script Parameters value as required.
The assets that were selected while creating the script are not displayed because you can perform the test only on the evaluation assets and not on production assets.
- Select the required assets and click Add.
-
Click
on the Add Asset Tags section to select lab asset tags.
-
To specify the tags, select the Any or All option from the list.
These options determine how assets are filtered and included in the report based on selected tags.
- Any: When you select Any, the system executes the script on the lab asset if it has at least one of the selected tags.
- All: When you select All, the system executes the script on the lab asset if it has all the selected tags. This means that the asset must have all the tags you selected.
- Enter a Description for the script.
- Select the following toggle switch as required:
- Bypass PowerShell Execution Policy: Use this toggle to specify if you want to override the PowerShell execution policy on Windows agents. When you switch this toggle to Yes, both signed and unsigned scripts are executed on the agent irrespective of the PowerShell execution policy set on the asset.
This option is displayed only if you test a Windows PowerShell script.
- Reboot Host after Script Execution: If you turn this toggle to Yes and set a delay, the system waits for the selected duration after the script execution completes and then initiates the reboot process.
The Delay before Reboot option enables you to specify a time period before the system is rebooted following the execution of a script.
This ensures a smooth transition between the execution of the script and the reboot process, allowing you to manage system changes in a controlled and efficient manner. - Monitor this script’s output for any changes: Use this toggle to share the script output to monitor and detect any changes to the FIM assets and displays those changes as events in FIM.
- Bypass PowerShell Execution Policy: Use this toggle to specify if you want to override the PowerShell execution policy on Windows agents. When you switch this toggle to Yes, both signed and unsigned scripts are executed on the agent irrespective of the PowerShell execution policy set on the asset.
-
Click Test Script.
Maximum of 10 assets can be tested at a time. Select tags option is not provided, since one tag may have more than 10 assets linked to it.
A new job is created and listed under the Jobs tab. For the test scripts, a job is created as: Test-ScriptName-TimestampEpoch (do not include milliseconds).
The manifest is executed every 15 minutes and the status is updated as 'Success' or 'Failure'.
In case of failure, you can edit the script and check for possible issues for failure. To edit a script, refer to Editing Scripts.