【发布时间】:2017-10-08 02:40:47
【问题描述】:
我正在尝试创建一个文件 .ps1 并使用 ruby 编写内容。但是我遇到了错误。下面是代码
output = File.open( "test.ps1", "w" )
output << "$a = type c://edmundsapi-final ;(Get-Content C:\inetpub\sites\tsd_atlasapi\AppSettings.config) -replace '(?<=<add key="Edmunds" value=")[^"]*', $a | Set-Content C:\inetpub\sites\tsd_atlasapi\AppSettings.config "
output.close
【问题讨论】:
-
你得到什么错误?
-
参见“minimal reproducible example”和 Jon Skeet 的“Writing the perfect question”
标签: ruby powershell