Skip to content

Instantly share code, notes, and snippets.

@chelnak
Created September 16, 2016 14:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chelnak/5c11b61c10c3dc56af2130a0d66ef873 to your computer and use it in GitHub Desktop.
Save chelnak/5c11b61c10c3dc56af2130a0d66ef873 to your computer and use it in GitHub Desktop.
Escape URI String with PowerShell
$URI = "/catalog-service/api/consumer/resourceViews/?withExtendedData=$($WithExtendedData)&withOperations=$($WithOperations)&managedOnly=$($ManagedOnly)&`$orderby=name asc&limit=$($Limit)&page=$($page)&`$filter=resourceType/id eq 'Infrastructure.Machine' or resourceType/id eq 'Infrastructure.Virtual' or resourceType/id eq 'Infrastructure.Cloud' or resourceType/id eq 'Infrastructure.Physical'"
$EscapedURI = [uri]::EscapeUriString($URI)
$Response = Invoke-vRARestMethod -Method GET -URI $EscapedURI -Verbose:$VerbosePreference
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment