Forum Discussion
AB21805
Mar 14, 2022Bronze Contributor
deleting a shortcut on desktop via intune
Hi all, How do I delete a shortcut via intune? I have created a shortcut using powershell but I had to update the URL which seems to have broke the shortcut so need to delete it and redeploy...
- Mar 15, 2022
AB21805 Changed it to handle both situations:
Detection:
$desktop = [Environment]::GetFolderPath("Desktop") if (Test-Path -Path "$($desktop)\Wifi Connect.lnk") { write-Host Found shortcut exit 1 } Else { Write-Host Shortcut not found exit 0 }Remediation:
$desktop = [Environment]::GetFolderPath("Desktop") Remove-Item -Path "$($desktop)\Wifi Connect.lnk" -Force:$true
Mar 15, 2022
Ok.. Just put in a Notepad and copy/paste from there perhaps?
AB21805
Mar 15, 2022Bronze Contributor
All set up
Are the config correct like 64 bit powershell?