【发布时间】:2018-03-14 06:29:28
【问题描述】:
考虑:
(Get-Content Rel_DDL.SQL) | ForEach-Object {
$_ -replace "SWIFT [\d\.]+", "SWIFT 2.4.0"
} | Set-Content Rel_DDL.SQL
上面的 PowerShell 代码将 SQL 文件中的 SWIFT 2.3.0 替换为 SWIFT 2.4.0,当我通过 PowerShell 运行时,它可以正常工作。
我想通过 Windows CMD 运行 PowerShell 命令,但出现错误。
【问题讨论】:
-
你能描述更多你的设置吗?通过文件位置、从 powershell 和 cmd 执行时的提示来增强您的问题。
标签: powershell cmd