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

Jan

I think I found out anyway :slight_smile:

In the app. ps1 file:

[CmdletBinding()]
Param (
[Parameter(Mandatory=$false)]
[ValidateSet(‘Install’,‘Uninstall’)]
[string]$DeploymentType = ‘Install’,
[Parameter(Mandatory=$false)]
[ValidateSet(‘Interactive’,‘Silent’,‘NonInteractive’)]
[string]$DeployMode = ‘Interactive’,
[Parameter(Mandatory=$false)]
[switch]$AllowRebootPassThru = $false,
[Parameter(Mandatory=$false)]
[switch]$TerminalServerMode = $false,
[Parameter(Mandatory=$false)]
[switch]$DisableLogging = $false
I could add the parameters here:
[Parameter(Mandatory=$false)]
[ValidateSet(‘Option1’,‘Option2’,‘Option3’)]
[string]$Blockapp = ‘Option1’,