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'
精彩评论