title: Add mstsc to shortcut target powershell
body: <p>A little background about what I'm trying to do and why.  We are slowly migrating from using a local copy of office on our end users Win7 machines to publishing office through RDS 2012. With 2012 you can have the end users machine subscribe to a webfeed which puts the shortcuts to the actual RDP files in Appdata.  In order to have our image pretty much mirror before RDS, I need to pin the shortcuts to the taskbar.  If you pin the shortcut as it comes from the RDS Gateway server the icon on the taskbar is that of the .rdp file.  If you edit the target for the shortcut and put mstsc.exe before the path to the .rdp file you can then pin the shortcut to the taskbar using those icons of the shortcut.  </p>
  
  <p>I have found posts on how to change the target field of shortcuts but nothing on how to add something to what is currently there.  An environment variable is needed since the path to the shorts will be different for each user.  Below is I have tried thus far</p>
  
  <pre><code>      $Word = $env:userprofile + "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\RemoteApp and Desktop Connections\Microsoft Word 2010.lnk"
  
        $sh = New-Object -COM WScript.Shell
        $targetPath = $sh.CreateShortcut($Word).TargetPath
        $sh.TargetPath = "mstsc.exe" + $targetPath ## Make changes
        $sh.Save()  ## Save$shell = New-Object -COM WScript.Shell
  </code></pre>
  
  <p>One of the errors i'm getting is : Property 'Arguments' cannot be found on this object; make sure it exists and is settable.</p>
  
  <p>Any help will be greatly appreciated.</p>