Run PowerShell script

The Run PowerShell script step will run either a specified file (e.g. "filename.ps1") or an inline script. In either case, you can specify parameters that are passed into the script when it is executed.

The inline script is edited using the same Monaco editing engine as is used in Visual Studio Code. Click the arrows icon at the top right of the script box to edit full screen, and again to reduce the size back to normal.

Note: If both script name and script values are populated, the script will be used.

When specifying an inline script, it will be saved to a file automatically before it is executed on the client, in order to properly handle parameter passing.

All output generated by the PowerShell script will automatically be captured by DeployR. Do not specify Start-Transcript or Stop-Transcript commands (they will fail).

To access the task sequence environment from within a script, import the DeployR.Utility module as shown above. That enables the TSEnv: and TSEnvList: drive providers.

Last updated