【问题标题】:Powershell Popup Box not showing when installing through SCCM通过 SCCM 安装时不显示 Powershell 弹出框
【发布时间】:2019-05-12 21:56:02
【问题描述】:

不知道如何解决它,但我想我有预感为什么 我有一个 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    "#>

【问题讨论】:

  • 在 SCCM 中,您为部署类型 > 用户体验配置了哪些设置?
  • 在用户体验选项卡中:安装行为 - 为系统安装 登录要求 - 仅当用户登录时 安装可见性 - 正常 允许用户与程序安装交互被选中 我已经玩过所有这些设置和运气不好,我认为这是因为弹出框显示在 SYSTEM 帐户而不是当前登录的用户上是否可以在 powershell 中使 msgbox 仅出现在当前登录的用户上下文中?
  • 由于不可能有一个真正静默的 powershell 脚本执行,您应该至少在一瞬间看到弹出的 powershell 窗口。这会发生吗?含义:这个设置对用户来说是不可见的还是只是消息框不可见?对我来说,这听起来像是 msgbox 失败而不是显示在某个错误的地方,因为他们的方式是你将 msgbox 编程到被接受之前,所以如果它显示在错误的用户会话 imo 中,它甚至不会继续。

标签: powershell sccm


【解决方案1】:

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

click here to see how to set user interaction

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-12-26
    • 2020-01-24
    • 1970-01-01
    • 1970-01-01
    • 2015-09-03
    • 2017-10-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多