You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Modules/CIPPCore/Public/Set-CIPPAuthenticationPolicy.ps1
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ function Set-CIPPAuthenticationPolicy {
58
58
'SMS' {
59
59
if ($State-eq'enabled') {
60
60
Write-LogMessage-headers $Headers-API $APIName-tenant $Tenant-message "Setting $AuthenticationMethodId to enabled is not allowed"-sev Error
61
-
return"Setting $AuthenticationMethodId to enabled is not allowed"
61
+
throw"Setting $AuthenticationMethodId to enabled is not allowed"
62
62
}
63
63
}
64
64
@@ -89,15 +89,15 @@ function Set-CIPPAuthenticationPolicy {
89
89
# Disallow enabling voice
90
90
if ($State-eq'enabled') {
91
91
Write-LogMessage-headers $Headers-API $APIName-tenant $Tenant-message "Setting $AuthenticationMethodId to enabled is not allowed"-sev Error
92
-
return"Setting $AuthenticationMethodId to enabled is not allowed"
92
+
throw"Setting $AuthenticationMethodId to enabled is not allowed"
93
93
}
94
94
}
95
95
96
96
# Email OTP
97
97
'Email' {
98
98
if ($State-eq'enabled') {
99
99
Write-LogMessage-headers $Headers-API $APIName-tenant $Tenant-message "Setting $AuthenticationMethodId to enabled is not allowed"-sev Error
100
-
return"Setting $AuthenticationMethodId to enabled is not allowed"
100
+
throw"Setting $AuthenticationMethodId to enabled is not allowed"
101
101
}
102
102
}
103
103
@@ -115,7 +115,7 @@ function Set-CIPPAuthenticationPolicy {
115
115
}
116
116
Default {
117
117
Write-LogMessage-headers $Headers-API $APIName-tenant $Tenant-message "Somehow you hit the default case with an input of $AuthenticationMethodId . You probably made a typo in the input for AuthenticationMethodId. It`'s case sensitive."-sev Error
118
-
return"Somehow you hit the default case with an input of $AuthenticationMethodId . You probably made a typo in the input for AuthenticationMethodId. It`'s case sensitive."
118
+
throw"Somehow you hit the default case with an input of $AuthenticationMethodId . You probably made a typo in the input for AuthenticationMethodId. It`'s case sensitive."
0 commit comments