I created this script for use with SCCM to allow easy creation of shortcuts during deployment for applications that do not create their own shortcut, or for portable applications that are not actually installed. The powershell script can be called upon from the “Run Command Line” step of a task sequence, and the script should be added as a Package to SCCM so that it can be referenced from the Package option inside the Run Command Line step.
This script generates shortcuts in the Public Desktop and the Start Menu. If a drive letter is specified in the path, it will be used. If no drive letter is specified in the path, the $env:SystemDrive variable will be used to figure out the drive letter based on the OS drive. If a URL is specified in the path, it will be used instead of a local path.
Here are some usage examples:
powershell -executionpolicy bypass -file generateShortcut.ps1 -name "Shortcut Name" -path "D:\test.txt"
powershell -executionpolicy bypass -file generateShortcut.ps1 "Shortcut 2" "Users\Administrator\Desktop\test.txt"
powershell -executionpolicy bypass -file generateShortcut.ps1 -name "Shortcut to Google" -path "https://www.google.com/"
Here is the full script: