Lets say I have a cmdlet:
function Set-Something
{
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string] $SomeValue
)
}
and some automation that calls my cmdlet:
Set-Something
This will make the powershell session halt and write this to screen:
cmdlet Set-Something at command pipeline position 1 Supply values for the following parameters: SomeValue:
This is downright annoying when doing automation: What we really want is for powershell to not Halt forever expecting user input that will never come, instead we simply want it to throw an exception "Missing parameter in call to Set-Something".
Is this possible?