Changes

Windows PowerShell 1.0 Security

412 bytes added, 17:09, 30 December 2008
Creating a Certificate
<pre>
PS C:\Users\Administrator> makecert -pe -n "CN=PowerShell Cert" -ss MY -a sha1 -eku 1.3.6.1.5.5.7.3.3 -iv cert.pvk -ic cert.cer
Succeeded
</pre>
<pre>
PS C:\Users\Administrator> dir get-childitem cert:\currentuser\my -codesigning codesign | fl
Subject : CN=PowerShell Cert
NotAfter : 12/31/2039 3:59:59 PM
Extensions : {System.Security.Cryptography.Oid, System.Security.Cryptography.Oid}
</pre>
 
As shown in the above output, the certificate creation process specified default start and end dates for period of validity. Different dates may be specified during creation through the use of the ''-b'' and ''-e'' options:
 
<pre>
PS C:\Users\Administrator> makecert -pe -n "CN=PowerShell Cert" -b 01/01/2009 -e 01/01/2020 -ss MY -a sha1
-eku 1.3.6.1.5.5.7.3.3 -iv cert.pvk -ic cert.cer
Succeeded
</pre>
== Signing a Windows PowerShell Script ==