From 8792f7d1f789372d849d5d13841b56a57ffae641 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 11 Nov 2020 13:51:51 -0800 Subject: [PATCH] Remove invalid characters in basename sourced from username (#1503) Co-authored-by: Ben Broderick Phillips --- eng/common/TestResources/New-TestResources.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eng/common/TestResources/New-TestResources.ps1 b/eng/common/TestResources/New-TestResources.ps1 index 3d3f95b561..535fd634fc 100644 --- a/eng/common/TestResources/New-TestResources.ps1 +++ b/eng/common/TestResources/New-TestResources.ps1 @@ -152,6 +152,8 @@ if (!$templateFiles) { } $UserName = if ($env:USER) { $env:USER } else { "${env:USERNAME}" } +# Remove spaces, etc. that may be in $UserName +$UserName = $UserName -replace '\W' # If no base name is specified use current user name if (!$BaseName) {