Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cdelashmutt-pivotal/3153256e142bc5a973477b681d47ab69 to your computer and use it in GitHub Desktop.
Save cdelashmutt-pivotal/3153256e142bc5a973477b681d47ab69 to your computer and use it in GitHub Desktop.
$(om -t <opsman-host> -u <admin-user> -p <admin-password> curl -s --path /api/v0/deployed/director/manifest | convertfrom-json | select -expand instance_groups | where {$_.name -eq 'bosh'} | select -expand properties | select -expand director | select -expand trusted_certs).Trim() -split '(?<!^)(?=-----BEGIN CERTIFICATE-----)' | where {$_ -ne ''} | foreach {$i=0} { $i++; $certArray = $_.Trim() -split '\n'; $cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate; $cert.Import([System.Convert]::FromBase64String(-join $certArray[1..($certArray.Length-2)])); Write-Host "Cert[$i]: $($cert.Subject) - $($cert.GetExpirationDateString())" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment