title: Create Shortcut to run with Powershell with Powershell
body: <p>I'm a bit lost. I want a powershell script that creates a shortcut linking to another powershell script. That shortcut should be able to run as administrator and the target should look like this. I made it manually like this and it works.</p>
  
  <p>Target: <code>C:\system32\windowspowershell\v1.0\powershell.exe -executionpolicy bypass -noexit "TARGETPATH\test.ps1"</code></p>
  
  <p>This is my code, but the arguments appear behind the target path instead in front of. </p>
  
  <p>Is there also a possibility to replace the default logo to a specific one? i.e. the one of powershell</p>
  
  <p>Any suggestions?</p>
  
  <p>Thanks!</p>
  
  <pre><code>#Read current path
  function Get-ScriptDirectory {
      $Invocation = (Get-Variable MyInvocation -Scope 1).Value
      Split-Path $Invocation.MyCommand.Path
  }
  $installpath = Get-ScriptDirectory
  
  #create shortcut
  $WshShell = New-Object -comObject WScript.Shell
  $Shortcut = $WshShell.CreateShortcut("$installpath\EXE.lnk")
  $Shortcut.TargetPath = """$installpath\test.ps1"""
  $Shortcut.Arguments = "argumentA ArgumentB"
  $Shortcut.WorkingDirectory = "$installpath"
  $Shortcut.Save()
  </code></pre>