top of page

PowerShell Parameters

#Format for requiring multiple parameters to be entered

#Would be declared at the start of the script this would 

#assure that the input variables the script requires to #execute correctly has been entered. 


Woman Studying

Parameter declaration can have many options. The one below has been set to require input from the user when executing the script and assigns the value to the variable $computerNames. This allows for programmers to force some type of control to end users.

# Mandatory=$True <-- Statement says the script requires a input parameter

# Has to appear at the top of the script or function 

# The parameter input will assign the value to the $computerNames variable 
Write-Output $computerNames

bottom of page