Parameter Passing From Command Line, How to?

I need to pass parameters from the command line, that launches Deploy-Application.exe. The situation is, that I would like to build a generic PSADT script to be used as a prerun, prompting the user to accept/defer start of a task sequence installation and to close down programs that shouldn’t run while the TS is running.

So I would like to run “Deploy-Application.exe Prerun.ps1” with application names (e.g. autocad, iexplore etc.) as arguments on the command line.

Any ideas?

Best regards


I think I found out anyway :slight_smile:

In the app. ps1 file:

Param (
[string]$DeploymentType = ‘Install’,
[string]$DeployMode = ‘Interactive’,
[switch]$AllowRebootPassThru = $false,
[switch]$TerminalServerMode = $false,
[switch]$DisableLogging = $false
I could add the parameters here:
[string]$Blockapp = ‘Option1’,