Iam使用以下命令在服务器上静默安装service pack
H:\>powershell.exe -executionpolicy bypass -noninteractive -nologo -file path\SP_Ins
tallation.ps1 ax-riscvmsql68\sql68 d:\sysdba\SQLServer2008SP4-KB2979596-x64-E
NU.exe 2>&1在powershell 4.0版上运行此命令时,iam未收到任何错误
当iam在1.0版本上运行相同的命令时,它给出了以下错误
H:\>powershell.exe -executionpolicy bypass -noninteractive -nologo -file path\SP_Installation.ps1 ax-riscvmsql68\sql68 d:\sysdba\SQLServer2008SP4-KB2979596-x64-ENU.exe 2>&1
Missing expression after unary operator '-'.
At line:1 char:2
+ -e <<<< xecutionpolicy bypass -noninteractive -nologo -file path\SP_Installation.ps1 ax-riscvmsql68\sql68 d:\sysdba\SQLServer2008SP4-KB2979596-x64-ENU.exe您能帮我解决一下吗,因为powershell 1.0版不能识别执行策略
发布于 2017-09-13 22:16:37
根据this article的说法
在Powershell v1.0中,您只能使用restricted、remotesigned、Allsigned和unrestricted。
不要加载配置文件或运行脚本。这是default.
要求所有脚本和配置文件都由受信任的发行者签名,包括在loca l computer.
要求从互联网下载的所有脚本和配置文件都由受信任的publisher.
加载所有配置文件并运行所有脚本。如果运行从internet下载的未签名脚本,则在运行之前会提示您输入权限。
正如@Ansgar Wiechers所说的,请远离v1.0...它非常过时,大多数系统都使用v3.0或更高版本。与其他更新版本相比,v1.0中不提供某些命令和特性。
发布于 2017-09-21 14:46:06
因此这是一个解决方案,您不能使用powershell版本1.0来执行策略主机需要在powershell版本2.0 +上
https://stackoverflow.com/questions/46194790
复制相似问题