PowerShellで引数を必須にする
PowerShellで引数を必須にする
各パラメーターの頭にParameter(?Position=0, Mandatory)属性を付与する。
https://stackoverflow.com/questions/7160443/how-do-i-make-parameters-mandatory-in-powershell
code:powershell
CmdletBinding()
param(
Parameter(Mandatory)String$MandatoryParameter,
String$nonMandatoryParameter,
Parameter(Mandatory)String$anotherMandatoryParameter
)