title: Create Shortcut using PowerShell Script
body: <p>I am trying to create a shortcut on desktop using a Powershell Script. However, I got an error code when trying to run the code below.</p>
  <pre><code>$new_object = New-Object -ComObject WScript.Shell
  $destination = $new_object.SpecialFolders.Item(&quot;AllUsersDesktop&quot;)
  $source_path = Join-Path -Path $destination -ChildPath &quot;\\Test Intranet.url&quot;
  $source = $new_object.CreateShortcut($source_path)
  $source.TargetPath = &quot;https://sharepoint.com/&quot;
  $source.IconLocation=&quot;C:\Users\Public\Pictures\ShortcutIcon.ico&quot;
  $source.Save()
  </code></pre>
  <p>Any help will be appreciated.
  Thanks.</p>