Fix user password

This commit is contained in:
2024-04-29 08:24:43 +00:00
parent 0fe18d71c0
commit e303a96ac9

View File

@@ -44,9 +44,9 @@ function SetupUser {
[string] $group
)
if ($password -eq "") {
$SecurePassword = ConvertTo-SecureString -String $password -AsPlainText -Force
} else {
$SecurePassword = [securestring]::new()
} else {
$SecurePassword = ConvertTo-SecureString -String $password -AsPlainText -Force
}
if ($null -eq $(Get-LocalUser -Name $username -ErrorAction SilentlyContinue)) {
Write-Host "User $username doesn't exist. Creating the user..."