title: PowerShell Script digitally signed error
body: <p>I'm getting an error when I run a PowerShell script:</p>
  
  <blockquote>
    <p>File test_new.ps1 cannot be loaded. The file test_new.ps1 is not digitally signed.</p>
  </blockquote>
  
  <p>I created a CA and a certificate and signed this file using the procedure described <a href="https://community.spiceworks.com/how_to/122368-signing-a-powershell-script-with-a-self-signed-certificate" rel="nofollow noreferrer">here</a>.</p>
  
  <p>Here is when I do a <code>dir</code> on the <code>MY</code> directory:</p>
  
  <pre>
  EF76B3D7D8D2406E1F2EE60CC40644B122267F18  CN=PowerShell User
  </pre>
  
  <p>I can see the signature block appended at the end of the <code>test_new.ps1</code> file.</p>
  
  <p>Here is the execution policy and scope:</p>
  
  <pre>
          Scope ExecutionPolicy
          ----- ---------------
  MachinePolicy       AllSigned
     UserPolicy       Undefined
        Process          Bypass
    CurrentUser       AllSigned
   LocalMachine       Undefined
  </pre>
  
  <p>The machinepolicy should take priority which is set as <code>AllSigned</code>. Everything seems allright, why am I still getting the digitally signed error.</p>