【发布时间】:2018-10-03 01:07:46
【问题描述】:
在为文件名文本添加双引号时,我一直很痛苦地发现我在哪里出错了。以下代码在 -whatif 保护伞下运行良好,但并非没有。
$a = "20`" board"
get-childitem | rename-item -newname {$_.fullname -replace "20 board", $a } -whatif
get-childitem | rename-item -newname {$_.fullname -replace "20 board","20`" board" } -whatif
期望的结果是将20 board 替换为20" board。
上面的 sn-ps 给我一个rename-item : Illegal characters in path. 错误。
【问题讨论】:
标签: powershell filenames illegal-characters