From 9d29bbb81bcdac0a77142342e2dbef6094f55beb Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 11 Nov 2020 13:53:30 -0800 Subject: [PATCH] Remove invalid characters in basename sourced from username (#17489) 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 3d3f95b561a41..535fd634fc081 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) {