有人可以帮我吗?我遇到了从天蓝色Blob存储与配置文件结合在一起运行EXE的问题。从Blob调用exe,然后需要一个参数,该参数调用与exe文件相同的Blob目录中的xml配置文件。该exe文件称为罚款,但配置文件不是。有什么想法吗?
如果我运行c:\ temp \ setup.exe / configure configuration.xml,它运行良好,所以我真的不确定吗?
$Path = $env:TEMP
$Installer = "setup.exe"
$OfficeConfig = "configuration.xml"
Invoke-WebRequest "https://********.blob.core.windows.net/office1/setup.exe?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-07-16T16:00:03Z&st=2019-07-16T08:00:03Z&spr=https&sig=7sO7m3PJMne8hFYAwHY6YFZZG6AfUuhC8x%2BoR7QkWuY%3D" -OutFile $Path\$Installer
Invoke-WebRequest "https://********.blob.core.windows.net/office1/Configuration.xml?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-07-16T16:00:03Z&st=2019-07-16T08:00:03Z&spr=https&sig=7sO7m3PJMne8hFYAwHY6YFZZG6AfUuhC8x%2BoR7QkWuY%3D" -OutFile $Path\$OfficeConfig
Start-Process -FilePath $Path\$Installer -Argumentlist'/configure $Path\$OfficeConfig' -Verb RunAs -Wait
Remove-Item $Path\$Installer
答案 0 :(得分:0)
对于single quote
cmdlet中的double quote
,应将-Argumentlist parameter
更改为Start-Process
,如下所示:
将-Argumentlist '/configure $Path\$OfficeConfig'
更改为-Argumentlist "/configure $Path\$OfficeConfig"