powershell_cheat_sheet
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| powershell_cheat_sheet [2020/12/07 18:24] – stephen | powershell_cheat_sheet [2021/04/13 21:53] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 59: | Line 59: | ||
| </ | </ | ||
| - | ===== Search installed certs for thumbprint | + | ===== Certificates |
| + | |||
| + | Search by thumbprint: | ||
| <code powershell> | <code powershell> | ||
| Line 69: | Line 71: | ||
| <code powershell> | <code powershell> | ||
| Get-ChildItem -Path Cert: -Recurse | Where-Object { $_.Thumbprint -and $_.Thumbprint.ToLower().StartsWith(' | Get-ChildItem -Path Cert: -Recurse | Where-Object { $_.Thumbprint -and $_.Thumbprint.ToLower().StartsWith(' | ||
| + | </ | ||
| + | |||
| + | To check for expired / revoked certs: | ||
| + | |||
| + | <code powershell> | ||
| + | $certs = Get-ChildItem -Path Cert: | ||
| + | foreach ($cert in $certs) { | ||
| + | Write-Host " | ||
| + | |||
| + | if ($certs.NotAfter -lt (Get-Date)) { | ||
| + | Write-Host " | ||
| + | } | ||
| + | elseif ($cert | Test-Certificate) { | ||
| + | Write-Host " | ||
| + | } | ||
| + | } | ||
| </ | </ | ||
| Line 86: | Line 104: | ||
| - Run '' | - Run '' | ||
| - Once installation is complete, comment out commands and change password. | - Once installation is complete, comment out commands and change password. | ||
| + | |||
| + | If this doesn' | ||
| ===== No Sleep ===== | ===== No Sleep ===== | ||
powershell_cheat_sheet.1607365480.txt.gz · Last modified: 2020/12/08 19:24 (external edit)
