I have been referring to answer number three of this post to write my PowerShell script, but it doesn't appear to be working.
$linkPath = Join-Path ([Environment]::GetFolderPath("Desktop")) "My shortcut.lnk"
$targetPath = Join-Path ([Environment]::GetFolderPath("MyDocuments")) "...\run.exe"
$link = (New-Object -ComObject WScript.Shell).CreateShortcut($linkPath)
$link.TargetPath = $targetPath
## Added after grawity's post
$link.Save()
It only prints out the code in the output pane but never seems to fully execute; no shortcut shows up on the desktop.
