From 7154dedae51a89a8ef15a4b1b2994b3773c8e00d Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 5 Oct 2021 11:55:44 -0700 Subject: [PATCH] Handle multiple segments in service directory path (#18015) Co-authored-by: Ben Broderick Phillips --- eng/common/TestResources/New-TestResources.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/common/TestResources/New-TestResources.ps1 b/eng/common/TestResources/New-TestResources.ps1 index efb4796bc521..3be542213361 100644 --- a/eng/common/TestResources/New-TestResources.ps1 +++ b/eng/common/TestResources/New-TestResources.ps1 @@ -329,9 +329,9 @@ try { $sp.Id } - # If the ServiceDirectory is an absolute path use the last directory name - # (e.g. D:\foo\bar\ -> bar) - $serviceName = if (Split-Path -IsAbsolute $ServiceDirectory) { + # If the ServiceDirectory has multiple segments use the last directory name + # e.g. D:\foo\bar -> bar or foo/bar -> bar + $serviceName = if (Split-Path $ServiceDirectory) { Split-Path -Leaf $ServiceDirectory } else { $ServiceDirectory @@ -916,4 +916,4 @@ Run this in an Azure DevOps CI (with approrpiate variables configured) before executing live tests. The script will output variables as secrets (to enable log redaction). -#> \ No newline at end of file +#>