title: signing PowerShell Scripts
body: <p>i am trying to sign my powershell scripts so i can execute them with no problems. I have my code signing cert created on my system and can view it from inside PowerShell. When i go to sign it i keep getting errors</p>
  
  <pre><code>PS C:\xxadmin&gt; get-childitem cert:\CurrentUser\my -codesign
  
  
      Directory: Microsoft.PowerShell.Security\Certificate::CurrentUser\my
  
  
  Thumbprint                                Subject
  ----------                                -------
  6B43052FDE320530CD77B260CC9BD046B68D2351  CN=PowerShell User
  
  
  PS C:\xxadmin&gt;
  </code></pre>
  
  <p>Trying to sign using the following command.</p>
  
  <pre><code>Set-AuthenticodeSignature C:\xxadmin\iisbackup.ps1 @ (get-childitem cert:\CurrentUser\My -codesigning) [0]
  </code></pre>
  
  <p>This is the Error i get.</p>
  
  <blockquote>
    <p>Unrecognized token in source text. At
    line:1 char:52
    + Set-AuthenticodeSignature C:\xxadmin\iisbackup.ps1  &lt;&lt;&lt;&lt; @
    (get-childitem cert:\CurrentUser\My
    -codesigning) [0]
        + CategoryInfo          : ParserError: (:) [],
    ParentContainsErrorRecordException
        + FullyQualifiedErrorId : UnrecognizedToken</p>
  </blockquote>
  
  <p>Also once this script is signed will i need to install the cert on each machines i want to execute the script on?</p>