Skip to content

Commit

Permalink
Remove invalid characters in basename sourced from username (#1503)
Browse files Browse the repository at this point in the history
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
  • Loading branch information
azure-sdk and benbp authored Nov 11, 2020
1 parent 470dc8a commit 8792f7d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions eng/common/TestResources/New-TestResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8792f7d

Please sign in to comment.