提问人:newtoStack-J 提问时间:10/31/2023 更新时间:10/31/2023 访问量:15
脚本状态显示失败,但桌面图标已安装。通过 Intune 部署的脚本
Script status showing failed however, the desktop Icon is installed. Deployed script via Intune
问:
我在 Intune 中部署了以下脚本。
该脚本工作正常 - 它正在部署我想要的桌面图标。 但问题是,即使桌面图标在那里 - 它仍然在 Intune 状态页中显示为状态失败
#Variables creating local folder and download .ico file
$LocalIconFolderPath = "C:\Intune\Xxxxxxxxxxxxxxx"
$SourceIcon = "https://xxxxxxxx/xxxxxxxxlogo-wo-wb/xxxxxxxxlogo-wo-wb.ico"
$DestinationIcon = "C:\Intune\Xxxxxxxxxxxxxxx\xxxxxxxxlogo-wo-wb.ico"
#Step 1 - Create a folder to place the URL icon
New-Item $LocalIconFolderPath -Type Directory
#Step 2 - Download a ICO file from a website into previous created folder
curl $SourceIcon -o $DestinationIcon
#Step 3 - Add the custom URL shortcut to your Desktop with custom icon
$new_object = New-Object -ComObject WScript.Shell
$destination = $new_object.SpecialFolders.Item('AllUsersDesktop')
$source_path = Join-Path -Path $destination -ChildPath '\\Global Intranet.lnk'
$source = $new_object.CreateShortcut($source_path)
$source.TargetPath = 'https://xxxxxxxxxxxxx.sharepoint.com/sites/GlobalIntranet?web=1'
$source.IconLocation = ”C:\Intune\Xxxxxxxxxxxxxxx\xxxxxxxxlogo-wo-wb.ico”
$source.Save()
请建议我应该添加哪个命令,以便它检测到桌面图标已安装并将状态显示为成功。
答: 暂无答案
评论