Browse Source

上传文件至 ''

master
dark 6 months ago
parent
commit
8a6e98608f
  1. 15
      replaceTag.ps1

15
replaceTag.ps1

@ -0,0 +1,15 @@
# 接收4个参数,用于替换 参数1 文件中的 参数2:参数3 为 参数2:参数4
param (
[string]$filePath,
[string]$key,
[string]$oldValue,
[string]$newValue
)
# 替换 $filePath 文件中的 $key:$oldValue 为 $key:$newValue
Write-Output "replace $filePath ${key}:$oldValue to ${key}:$newValue then save to $filePath"
(Get-Content $filePath) -replace "${key}:$oldValue", "${key}:$newValue" | Set-Content $filePath
Get-Content $filePath
Loading…
Cancel
Save