In this example, we will perform an HTTP GET REST API request via PowerShell:
- Open a text editor, input the following code, and save it into a .ps1 extension, for example NSX-PowerShellGET.ps1:
# NSX Variables $NSXUsername = "admin" $NSXPassword = "VMware1!" $NSXManager = "https://nsxmgr-01a.corp.local" $NSXURI = "/api/2.0/services/usermgmt/user/admin" # NSX Authorization Header $NSXAuth = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($NSXUsername + ":" + $NSXPassword)) $NSXAuthHeader = @{"Authorization"="Basic $NSXAuth"} # Add code to allow untrusted SSL certs - taken from https://d-fens.ch/2013/12/20/nobrainer-ssl-connection-error-when-using-powershell/ Add-Type ...