Private/_HelperFunctions.ps1
function Add-QueryToUri { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string]$Uri, [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string]$Query ) $UriB = [System.UriBuilder]::new($Uri) if ( ($null -ne $UriB.Query) -AND ($UriB.Query.Length -gt 1) ){ $UriB.Query = $UriB.Query.Substring(1) + "&" + $Query } else{ $UriB.Query = $Query; } return $UriB.Uri.AbsoluteUri } |