Last active
August 8, 2016 17:09
-
-
Save techthoughts2/6b3e0c8ffdbec78a224a7aa38e6c5f59 to your computer and use it in GitHub Desktop.
Date manipulation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$certInfo = ls Cert:\LocalMachine\My | where { $_.Subject -eq $subject } | |
$expireDate = $certInfo.NotAfter | |
[int]$daysRemaining = New-TimeSpan -End $expireDate | Select-Object -ExpandProperty Days | |
$date = Get-Date | |
$1weekOut = $date.AddDays(7) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment