Microsoft.PowerShell.Security module: setup and commands
Documentation: Microsoft Learn
Inspect execution policy, signatures and secure strings with security cmdlets while treating execution policy as a safety feature, not a boundary.
Getting it
Included with PowerShell, although the Cert: provider and the execution policy cmdlets only do meaningful work on Windows.
Examples
Show reference output
Show reference output
What it is for
Come here to find out why a script refuses to run, or to check who signed one. It also backs the Cert: drive, which makes it the starting point for certificate expiry audits on a Windows host.
Typical tasks
- List execution policy by scope
- Verify an Authenticode signature on a script
- Enumerate certificates in the LocalMachine store
- Find certificates close to expiry
- Prompt for a credential object
- Sign a script with Set-AuthenticodeSignature
Check the installed version
Compare the module path and version with the session used by your scheduled task or automation account. Come here to find out why a script refuses to run, or to check who signed one. It also backs the Cert: drive, which makes it the starting point for certificate expiry audits on a Windows host.