Powershell pitfalls

后端 未结 21 1414
梦谈多话
梦谈多话 2020-12-23 01:44

What Powershell pitfalls you have fall into? :-)

Mine are:

# -----------------------------------
function foo()
{
    @(\"text\")
}

# Expected 1, a         


        
21条回答
  •  一个人的身影
    2020-12-23 02:16

    This works. But almost certainly not in the way you think it's working.

    PS> $a = 42;
    PS> [scriptblock]$b = { $a }
    PS> & $b
    42
    

提交回复
热议问题