开发者

Problem with dash symbol in powershell

I want to use dash symbol in xml node name but when i try to get that node it says something about unexpect开发者_JAVA百科ed token.

<hudson.scm.SubversionSCM_-ModuleLocation>
<remote>svn://svn.something.ru/testlib/trunk/SOAPUI/pmplatform/email</remote> 
</hudson.scm.SubversionSCM_-ModuleLocation>

$xmlone = New-Object XML
$xmlone.Load($scriptRoot+"\config.xml")
$xmlone.project.scm.locations.hudson.scm.SubversionSCM_-ModuleLocation


Try quoting the name that has dashes in it:

PS > $xml = [xml]'<root><dash-it-all>text</dash-it-all></root>'
PS > $xml.root.'dash-it-all'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜