Skip to content

Commit

Permalink
create-1es-hosted-pool.ps1: Avoid ConvertTo-SecureString (#4535)
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanTLavavej authored Mar 29, 2024
1 parent 4a14a49 commit be81252
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions azure-devops/create-1es-hosted-pool.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ function New-Password {
}
}

$result = ''
[SecureString] $result = [SecureString]::new()
for ($idx = 0; $idx -lt $Length; $idx++) {
$result += $alphabet[$randomData[$idx] -band $mask]
$result.AppendChar($alphabet[$randomData[$idx] -band $mask])
}

return $result
Expand Down Expand Up @@ -143,8 +143,7 @@ New-AzResourceGroup `
####################################################################################################
Display-ProgressBar -Status 'Creating credentials'

$AdminPW = New-Password
$AdminPWSecure = ConvertTo-SecureString $AdminPW -AsPlainText -Force
$AdminPWSecure = New-Password
$Credential = New-Object System.Management.Automation.PSCredential ('AdminUser', $AdminPWSecure)

####################################################################################################
Expand Down

0 comments on commit be81252

Please sign in to comment.