使用installshield运行powershell脚本时,Enable-ADFSEndpoint无法成功

时间:2013-01-29 20:36:05

标签: powershell installshield

我正在尝试从installshield调用powershell脚本,但是我在Enable-ADFSEndpoint行上遇到错误。

my pic

当我将此脚本粘贴到PowerShell本身时,它可以正常工作。但是当运行安装脚本的LaunchAppAndWait()函数时,它会失败。这是我的installshield代码:

Param1=WINDISK +"\\Windows\\Sysnative\\WindowsPowerShell\\v1.0\\powershell.exe";
Param2="-ExecutionPolicy remotesigned -File \""+ INSTALLDIR +"PSServer\\Support\\adfs_cmdlets.ps1\""; 
LaunchAppAndWait(Param1, Param2, LAAW_OPTION_WAIT);

脚本代码如下:

Add-PSSnapin Microsoft.Adfs.PowerShell

#ENABLE ENDPOINTS
Enable-ADFSEndpoint –TargetAddress "/adfs/services/trust/2005/windows"
Enable-ADFSEndpoint –TargetAddress "/adfs/services/trust/13/windows"

当然有比这更多的脚本,但是在通过installshield执行时,它没有进一步发展。

我非常喜欢installshield,所以任何提示都可能有所帮助,非常感谢。同样,我目前认为问题存在于installshield中,因为当我的powershell脚本通过powershell命令提示符调用时,它可以正常工作。提前感谢任何可能回应的人。

我也意识到我可能遗漏了重要信息,当然我愿意根据要求对其进行编辑。

0 个答案:

没有答案