Skip to content

Instantly share code, notes, and snippets.

@techthoughts2
Last active August 8, 2016 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techthoughts2/6b3e0c8ffdbec78a224a7aa38e6c5f59 to your computer and use it in GitHub Desktop.
Save techthoughts2/6b3e0c8ffdbec78a224a7aa38e6c5f59 to your computer and use it in GitHub Desktop.
Date manipulation
$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