Skip to content

Instantly share code, notes, and snippets.

@gowatana
Created October 27, 2020 14:17
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 gowatana/bd16ed6a3493c349cdff01b08bb93c82 to your computer and use it in GitHub Desktop.
Save gowatana/bd16ed6a3493c349cdff01b08bb93c82 to your computer and use it in GitHub Desktop.
# Get HAProxy CA Cert.
# Usage:
# PS> Connect-VIServer $vCenter_Address -Force
# PS> ./get_haproxy_vm_cacert.ps1 $ha_proxy_vm_name
$VMname = $args[0]
$AdvancedSettingName = "guestinfo.dataplaneapi.cacert"
$Base64cert = Get-VM $VMname | Get-AdvancedSetting -Name $AdvancedSettingName
$cert = [Text.Encoding]::Utf8.GetString([Convert]::FromBase64String($Base64cert.Value))
$cert
@gowatana
Copy link
Author

gowatana commented Oct 29, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment