I have a simple script which does not work:
Param([string] $Input, [string] $Output)
Write-Host $Input
Write-Host $Output
The $Input parameter does not get printed:
PS> .\Get-Parameters.ps1 "First" "Second"
Second
If I rename $Input to $Joe the script works fine. $Input is not a reserved name.
What is going on? I am perplexed.
PowerShell’s
$inputis an automatic variable:basically
$inputin an enumerator which provides access to the actual pipeline.Reading about
$input