Problem with dash symbol in powershell

后端 未结 1 1671
别跟我提以往
别跟我提以往 2021-01-17 23:01

I want to use dash symbol in xml node name but when i try to get that node it says something about unexpected token.



        
相关标签:
1条回答
  • 2021-01-17 23:31

    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 讨论(0)
提交回复
热议问题