这是一个文本示例,包括我试图用以下内容覆盖文件的符号:
Home http://domain.tld
IP|http://domain.tld/path/1
Navbar, Top|http://domain.tld/
Tips/Tricks|#some text
Accordion 2|*more text
Text|=More Text
替换所有元字符,例如,
s!\t!symTA!g
s!\#!symHA!g
这是我的 Perl 代码:
`$ps New-Item $dir -Name $file -ItemType "file" -Force -Value "$out"`
但是,如果$out
只有一行没有任何空格,它就可以工作!
但它大约有100行!
它给出了类似于以下的各种错误:
术语 BlogsymPIhttpsymCOLsymFSsymFSbislinks.comsymFSblog 不被识别为 cmdlet、函数、脚本文件或可运行程序的名称。检查名称的拼写,或者如果包含路径,请验证路径是否正确并重试。在 line:2 char:1 + BlogsymPIhttpsymCOLsymFSsymFSbislinks.comsymFSblog
该文件已保存,但只有第一行(带有替换)。