我有一个已签名的PowerShell脚本,我想通过WiX安装程序将其部署到目标计算机。是否可以赋予剧本执行权?使用WiX安装Powershell脚本
问候, forki
- 编辑 - 看来我得叫PowerShell和--command的Set-ExecutionPolicy RemoteSigned就是,但我无法得到它的工作。我看到Powershell命令窗口打开,但不会更改策略。
<Property Id="POWERSHELLEXE"><![CDATA[C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe]]></Property> <CustomAction Id="AllowPS" Property="POWERSHELLEXE" ExeCommand="-NoLogo -NoProfile -Command Set-ExecutionPolicy RemoteSigned" Execute="deferred" Return="check"/> <InstallExecuteSequence> .. <Custom Action="AllowPS" Before="InstallFinalize"/> ... </InstallExecuteSequence>
看来我必须使用--Command Set-ExecutionPolicy RemoteSigned来调用Powershell,但是我无法让它工作。 – forki23 2010-03-05 12:37:34
您是否在目标机器上使用PowerShell 1.0或2.0? – Goyuix 2010-03-05 16:24:54
我们有赢7 - 所以我认为它是2.0。 – forki23 2010-03-05 16:32:50