通过SCCM安装时未显示Powershell弹出框

时间:2016-06-07 01:03:29

标签: powershell sccm

不确定如何修复它,但我认为我对此有所预感 我有一个powershell脚本安装应用程序但在它开始之前它显示了一个msgbox,它只是向用户显示一条消息

当我手动运行脚本时,脚本运行正常,甚至通过psexec运行系统帐户也可以运行

但是,当通过SCCM - 软件中心进行部署时,它会安装而不显示msgbox ..

现在我认为可能是因为它没有在当前登录用户的上下文中显示..但是我会想通过Psexec运行它,因为系统也不会工作......

有人可以帮忙吗?我已使用此脚本通过sccm将其部署为应用程序:

<#
.Date: 01-Jun-2016
.Ansys 16.2 Install Script


# Set up some Variables
$workingDirectory = (split-path $myinvocation.mycommand.path -parent)

# Display a warning message before installation begins
Add-Type -AssemblyName Microsoft.VisualBasic
[Microsoft.VisualBasic.Interaction]::MsgBox('Ansys 16.2 takes over 30 mins to install. Please do not log out or shutdown your computer during the installation. You can continue working as normal while it is being installed. Once complete you will see in Software Center say "installed" next to Ansys 16.2.', 'OKOnly,SystemModal,Exclamation', 'Warning')

# ***** Install Application ******
Start-Process -FilePath "$WorkingDirectory\ANSYS162_WINX64_Disk1\setup.exe" -ArgumentList "-silent -disablerss -licserverinfo `"::licensing-b`"" -Wait -ErrorAction SilentlyContinue
Start-Sleep -s 3

# ***** Delete Shortcut and unlicensed products *******
Remove-Item "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\ANSYS 16.2\Uninstall ANSYS 16.2.lnk" -Force -ErrorAction SilentlyContinue
Remove-Item "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\ANSYS 16.2\ANSYS Icepak 16.2.lnk" -Force -ErrorAction SilentlyContinue
Remove-Item "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\ANSYS 16.2\Aqwa" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\ANSYS 16.2\ACP" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\ANSYS 16.2\ANSYS Client Licensing" -Recurse -Force -ErrorAction SilentlyContinue    "#>

1 个答案:

答案 0 :(得分:0)

确保在部署时已选中“允许用户与该程序交互”选项

click here to see how to set user interaction