$ PSScriptRoot和XML.SelectNodes支持powershell 2.0

时间:2014-08-28 17:05:53

标签: powershell-v2.0 powershell-v3.0

我知道PowerShell 2.0不支持$ PSScriptRoot,有什么好的选择?

还支持PowerShell 2.0支持SelectNodes吗?

使用2.0进行XML操作的优秀cmdlet是什么?

1 个答案:

答案 0 :(得分:1)

$ PSScriptRoot不起作用,另类

$ PSScriptRoot = Split-Path -Parent -Path $ MyInvocation.MyCommand.Definition

支持SelectNodes