You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

通过官方PowerShell脚本应用Shell Launcher配置失败求助

通过官方PowerShell脚本应用Shell Launcher配置失败求助

各位好,我现在碰到个Shell Launcher配置的问题,想请大家帮忙看看。

我需要给一批PC配置Shell Launcher,目前先在一台测试机上做验证。我已经跟着官方文档完成了XML配置文件的编写,但在用文档里提供的PowerShell脚本应用配置时出现了错误,脚本执行到Set-CimInstance那一步就卡壳了,只提示部分错误信息,看不到完整内容,也搞不清问题出在哪。

我用的官方脚本大致是这样的:

$shellLauncherConfiguration = @"
# content of the XML configuration file
"@

$namespaceName="root\cimv2\mdm\dmmap"
$className="MDM_AssignedAccess"
$obj = Get-CimInstance -Namespace $namespaceName -ClassName $className
$obj.Configuration = [System.Net.WebUtility]::HtmlEncode($shellLauncherConfiguration)
$obj = Set-CimInstance -CimInstance $obj -ErrorVariable cimSetError -ErrorAction SilentlyContinue
if($cimSetError) {
    Write-Output "An ERROR occurred. Displaying error details:"
    Write-Output $cimSetError
}

(注:我把原本截断的错误输出逻辑补全了,方便大家理解)

有没有大佬能指点下我该从哪些方面排查问题?比如权限、XML格式、脚本本身的逻辑之类的?

备注:内容来源于stack exchange,提问作者gbos

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.15 11:37:58