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 +#>