Pass object[] into a function in PowerShell

后端 未结 1 1242
遥遥无期
遥遥无期 2020-11-27 22:34

Is there a resource on how to pass in a Object[] as a parameter within a PowerShell function?

Both of these functions are cmdlets and they are being exp

相关标签:
1条回答
  • 2020-11-27 23:06

    $Input is the name of an automatic variable. Use a different name.

    I recommend $InputObject as that is in common usage so it has a well-understood meaning, but usually that means you are accepting pipeline input as well.

    Of course if there's a name that's more descriptive for this parameter, you should use that.

    I have submitted this issue on the PowerShell GitHub project suggesting that Set-StrictMode be modified to check for automatic variable assignment.

    0 讨论(0)
提交回复
热议问题