【发布时间】:2012-09-11 15:50:42
【问题描述】:
$FilePath = 'Z:\next\ResourcesConfiguration.config'
$oldString = 'Z:\next\Core\Resources\'
$NewString = 'G:\PublishDir\next\Core\Resources\'
任何想法如何替换具有 : 登录的字符串。我想更改配置文件中的路径。简单的代码对此不起作用。尝试关注
(Get-Content $original_file) | Foreach-Object {
$_ -replace $oldString, $NewString
} | Set-Content $destination_file
【问题讨论】:
-
请为输入字符串提供所需的输出。
标签: string powershell replace literals