Passing null to a mandatory parameter to a function

后端 未结 4 1291
暗喜
暗喜 2021-01-03 21:18

Effectively my problem comes down to this:

I can\'t have a function with a mandatory parameter and pass $null to that parameter:

Function Foo
{
    P         


        
4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-03 22:08

    I think you missed the "," to separate the parameters.

    Param (
        [string]$ObjectName,
        [int]$ObjectId,
        [wmi]$Object
    )
    

提交回复
热议问题