我正在尝试修改config.xml
config.xml
内容
<command>
some lines here 2
</command>
some lines here 3
所以我想替换&lt; command>
和</command>
之间的内容。这是我尝试做的事情
$Replace = Get-Content D:\Temp\Replace.txt
$ReplaceWith = Get-Content D:\Temp\ReplaceWith.txt
$regex = '(<command>\d*).*?(</command>\d*)'
$Replace -replace $regex, $ReplaceWith
但它不起作用。需要帮助。
答案 0 :(得分:0)
感谢gms0ulman。我能够在powershell中使用read作为xml,下面是代码
Sheet1.MyListBox.Selected(0) = True