From 6cc6573e0613f5f3ff5c3fd91a73c7282b772d09 Mon Sep 17 00:00:00 2001 From: octopusbob Date: Thu, 13 Aug 2020 16:27:49 -0500 Subject: [PATCH] Handle virtual directories a bit better --- src/DataAccess/OctopusDataAdapter.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/DataAccess/OctopusDataAdapter.ps1 b/src/DataAccess/OctopusDataAdapter.ps1 index 015c899..455f7b1 100644 --- a/src/DataAccess/OctopusDataAdapter.ps1 +++ b/src/DataAccess/OctopusDataAdapter.ps1 @@ -8,7 +8,12 @@ function Get-OctopusUrl if ($EndPoint -match "/api") { - return "$OctopusUrl/$endPoint" + if (!$EndPoint.StartsWith("/api")) + { + $EndPoint = $EndPoint.Substring($EndPoint.IndexOf("/api")) + } + + return "$OctopusUrl/$EndPoint" } if ([string]::IsNullOrWhiteSpace($SpaceId))