Delete shortcut

I was able to create a shortcut using the New-Shortcut command. When i uninstall the application, the shortcut stays behind.
What i am hoping to do is part of the uninstall portion I tell it to remove that shortcut. Is this possible?

I think it would be a nice function to have in the toolkit as well.

When you create the shortcut, you need to specify the file name like this:

New-Shortcut -Path “$envCommonDesktop\Dragon Direct.lnk” -TargetPath “C:\Program Files\Dragon Direct\Standalone\SoD.exe” -Arguments ‘-user %username%’ -IconLocation “C:\Program Files\Dragon Direct\Standalone\SoD.exe” -Description “Dragon Direct” -WorkingDirectory “C:\Program Files\Dragon Direct\Standalone”

To remove the shortcut, just use the Remove-File function like this:

Remove-File -Path “$envCommonDesktop\Dragon Direct.lnk”

Thanks Jim, that works.