$FilePath = 'Z:\next\ResourcesConfiguration.config'
$oldString = 'Z:\next\Core\Resources\'
$NewString = 'G:\PublishDir\next\Core\Resources\'
任何想法如何替換具有以下內容的字符串:登錄它。我想更改配置文件中的路徑。簡單的代碼不適用於此。嘗試以下傳遞字符串包含:在PowerShell腳本中的替換變量
(Get-Content $original_file) | Foreach-Object {
$_ -replace $oldString, $NewString
} | Set-Content $destination_file
請爲輸入字符串提供所需的輸出。 – vonPryz