Skip to content

Instantly share code, notes, and snippets.

@joeywas
Created June 10, 2025 02:25
Show Gist options
  • Select an option

  • Save joeywas/47c5aab385a74fc1aa6714f3853ade2b to your computer and use it in GitHub Desktop.

Select an option

Save joeywas/47c5aab385a74fc1aa6714f3853ade2b to your computer and use it in GitHub Desktop.
$SWURI = 'https://solarwinds.internal.domain:17778/Solarwinds/InformationService/v3/Json'
$Payload = "@{'query' = 'SELECT TOP 10 NodeID from Orion.Nodes'}"
$Credential = Get-Credential
$splat = @{
Uri = $SWURI
Method = 'POST'
contenttype = 'application/json'
Body = $Payload
Credential = $Credential
SkipCertificateCheck = $true
ErrorAction = 'Stop'
}
# Do something, hopefully store something in the results
$Results = Invoke-RestMethod @splat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment