Scripting Examples - Simple inline script.

PowerShell scripts in DeployR Task Sequences can be as simple or as complex as you like. A simple PowerShell Step can look like this:

Get-ChildItem tsenv:

That simple script, you can paste right into a step, and it will return a list of all of the Task Sequence Variables, which will then show up in the DeployR log. I typically add this for debugging to see what the variables are at a specific point in the Task Sequence.

Now that's an extreme example of how simple this can be. One more quick example would be to have your step install a module and run another command. An example of updating HP BIOS while in WinPE:

install-module -name HPCMSL -AcceptLicense -SkipPublisherCheck -Force
if ((Get-HPBIOSUpdates -Check) -eq $false){Get-HPBIOSUpdates -Flash -Yes -Bitlocker Ignore}

This step also supports longer scripts, which you can more easily view by clicking the enlarge icon on the upper right corner of the script dialog box.

It will then open into the full screen of the browser. you can click the blue minimize button in the upper right to return to normal view.

Last updated