PowerShell Studio: Verify Script
- Written by David Corrales
- Last Updated: 22 April 2016
- Created: 07 August 2014
- Hits: 5257
We offered a mechanism on how to import a remote machine’s Module profile as mentioned here. The import can be extremely useful when you need to work on a script that runs on a remote server.
PowerShell Studio includes a feature that lets you verify that your script will run on the remote machine by comparing the cmdlets and modules used in the script with those available on the remote machine. The Verify Script command will then produce a report listing all the missing modules and cmdlets on the selected machine.
Verifying your Scripts:
Start by selecting the appropriate machine from the Platform section in the Ribbon’s Home tab:
If you wish to select a remote machine, you will need to import the remote machine’s cache beforehand.
Next go to the Ribbon’s Tools Tab and press the Verify Script button:
PowerShell Studio will then evaluate the script and display the results in the Output panel:
PowerShell Studio’s editor offers a visual cue as to when a cmdlet is unknown:
As demonstrated, Verify Script offers a quick and simple way to verify that your script is capable of running on a remote machine. Even though PowerShell Studio identifies unknown commands as you type, the Verify Script makes it easier for you to determine the necessary modules for the script to run.