Skip to content

Commit effedec

Browse files
committed
Refactor password assignment logic in Invoke-ExecJITAdmin function for clarity
1 parent 01531ac commit effedec

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Identity/Administration/Users/Invoke-ExecJITAdmin.ps1

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,8 @@ function Invoke-ExecJITAdmin {
121121
$PasswordExpiration = $TapRequest.LifetimeInMinutes
122122

123123
$PasswordLink = New-PwPushLink -Payload $TempPass
124-
if ($PasswordLink) {
125-
$Password = $PasswordLink
126-
} else {
127-
$Password = $TempPass
128-
}
124+
$Password = $PasswordLink ? $PasswordLink : $TempPass
125+
129126
$Results.Add("Temporary Access Pass: $Password")
130127
$Results.Add("This TAP is usable starting at $($TapRequest.startDateTime) UTC for the next $PasswordExpiration minutes")
131128
} catch {

0 commit comments

Comments
 (0)