Skip to content

Instantly share code, notes, and snippets.

@IISResetMe
Created March 6, 2019 16:29
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 IISResetMe/fb61c896e31ac368ee1627f90201625d to your computer and use it in GitHub Desktop.
Save IISResetMe/fb61c896e31ac368ee1627f90201625d to your computer and use it in GitHub Desktop.
function Join-Uri
{
param(
[Parameter(Mandatory = $true, Position = 0)]
[uri]$BaseUri,
[Parameter(Mandatory = $true, ValueFromRemainingArguments = $true)]
[string[]]$PathSegments
)
foreach($Segment in $PathSegments){
$BaseUri = [uri]::new($BaseUri,$Segment)
}
return $BaseUri
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment