PowerShell函数用Hash表传参实例
本文介绍在自定义PowerShell函数时,使用Hash表作为参数,它相当于将Hash表中的键当作参数名,而键的值当作参数值。先直接看看这个以Hash表作为参数赋值给函数的示例:复制代码 代码如下:$hash = @{ Path = $env:windir Filter = ‘*.ps1" Recurse = $true ErrorAction = ‘SilentlyContinue"}Get-ChildItem @hashGet-ChildItem这个c...