local:Get-GPPInnerFields - Only output a result if one of Password, Username, Changed or NewName is not blank.

This commit is contained in:
Michael Koehler 2017-09-29 22:12:15 -04:00
parent 173ba5c9e0
commit 198d9f78dd
1 changed files with 18 additions and 16 deletions

View File

@ -3681,6 +3681,7 @@ function Get-CachedGPPPassword {
$Password += , $DecryptedPassword $Password += , $DecryptedPassword
} }
if ($Password -or $UserName -or $Changed -or $NewName) {
# put [BLANK] in variables # put [BLANK] in variables
if (-not $Password) {$Password = '[BLANK]'} if (-not $Password) {$Password = '[BLANK]'}
if (-not $UserName) {$UserName = '[BLANK]'} if (-not $UserName) {$UserName = '[BLANK]'}
@ -3698,6 +3699,7 @@ function Get-CachedGPPPassword {
Write-Verbose "The password is between {} and may be more than one value." Write-Verbose "The password is between {} and may be more than one value."
if ($ResultsObject) {Return $ResultsObject} if ($ResultsObject) {Return $ResultsObject}
} }
}
catch {Write-Error $Error[0]} catch {Write-Error $Error[0]}
} }