【发布时间】:2017-01-31 19:47:51
【问题描述】:
我有一个文本文件,其中包含对其他文件的引用。我想要做的是运行一个脚本,它将在运行时用文件的内容替换文件名,然后将其卷曲到服务器。
谁能推荐一种在 windows 命令行上使用 powershell 或类似工具的快速方法?
例如
"responses": [
{
"is": {
"statusCode": 200,
"headers": {
"Location": "http://localhost:4545/myresponse",
"Content-Type": "application/xml"
},
"body": "@file:myresponse.xml"
}
}]
会变成:
"responses": [
{
"is": {
"statusCode": 200,
"headers": {
"Location": "http://localhost:4545/myresponse",
"Content-Type": "application/xml"
},
"body": "<xml> contents of myresponse.xml within same directory.. </xml>"
}
}]
【问题讨论】:
-
你知道PoSh与“windows命令行”无关吗? -- powershell.exe 不是 PoSh ;)
-
是的.. 我不是一个经验丰富的 Windows 脚本编写者,但是我认为与 powershell 相比,使用常规命令行脚本编写这将是相当困难的,但我想保持我的选项开放 :)跨度>
标签: windows command-line scripting text-files