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 for the lab assets.
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.
- (Optional) Toggle the Bypass PowerShell Execution Policy switch to Yes to specify if you want to override the PowerShell execution policy on Windows agents.
Enabling the bypass Powershell execution policy would allow signed as well as unsigned script to run irrespective execution policy set in the assets.
This option is displayed only if you test a Windows PowerShell script.
-
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.