From 0895315a504af783d18bcd6fe52b37f09cb5df2f Mon Sep 17 00:00:00 2001 From: Merill Fernando Date: Tue, 16 Apr 2024 19:50:17 +1000 Subject: [PATCH] Changed .ToString to Out-String to prevent exceptions on null objects --- powershell/public/eidsca/@templateps1.txt | 2 +- powershell/public/eidsca/Test-MtEidscaAF01.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAF02.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAF03.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAF04.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAF05.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAF06.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAG01.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAG02.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAG03.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAM01.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAM02.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAM03.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAM04.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAM06.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAM07.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAM09.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAM10.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAP01.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAP04.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAP05.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAP06.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAP07.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAP08.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAP09.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAP10.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAP14.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAT01.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAT02.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaAV01.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaCP01.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaCP03.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaCP04.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaCR01.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaCR02.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaCR03.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaCR04.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaPR01.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaPR02.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaPR03.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaPR05.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaPR06.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaST08.ps1 | 2 +- powershell/public/eidsca/Test-MtEidscaST09.ps1 | 2 +- 44 files changed, 44 insertions(+), 44 deletions(-) diff --git a/powershell/public/eidsca/@templateps1.txt b/powershell/public/eidsca/@templateps1.txt index 2cf4d1d7..648e2311 100644 --- a/powershell/public/eidsca/@templateps1.txt +++ b/powershell/public/eidsca/@templateps1.txt @@ -23,7 +23,7 @@ Function %PSFunctionName% { $result = Invoke-MtGraphRequest -RelativeUri "%RelativeUri%" -ApiVersion %ApiVersion% - $tenantValue = ($result.%CurrentValue%).ToString() + $tenantValue = $result.%CurrentValue% | Out-String -NoNewLine $testResult = $tenantValue -eq %RecommendedValue% if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAF01.ps1 b/powershell/public/eidsca/Test-MtEidscaAF01.ps1 index ee19d1fe..f7bc3bba 100644 --- a/powershell/public/eidsca/Test-MtEidscaAF01.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAF01.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAF01 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')" -ApiVersion beta - $tenantValue = ($result.state).ToString() + $tenantValue = $result.state | Out-String -NoNewLine $testResult = $tenantValue -eq 'enabled' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAF02.ps1 b/powershell/public/eidsca/Test-MtEidscaAF02.ps1 index 1fc95f62..71574c50 100644 --- a/powershell/public/eidsca/Test-MtEidscaAF02.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAF02.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAF02 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')" -ApiVersion beta - $tenantValue = ($result.isSelfServiceRegistrationAllowed).ToString() + $tenantValue = $result.isSelfServiceRegistrationAllowed | Out-String -NoNewLine $testResult = $tenantValue -eq 'true' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAF03.ps1 b/powershell/public/eidsca/Test-MtEidscaAF03.ps1 index a41b770e..d974edca 100644 --- a/powershell/public/eidsca/Test-MtEidscaAF03.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAF03.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAF03 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')" -ApiVersion beta - $tenantValue = ($result.isAttestationEnforced).ToString() + $tenantValue = $result.isAttestationEnforced | Out-String -NoNewLine $testResult = $tenantValue -eq 'true' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAF04.ps1 b/powershell/public/eidsca/Test-MtEidscaAF04.ps1 index 4452ffbb..fc15d9a9 100644 --- a/powershell/public/eidsca/Test-MtEidscaAF04.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAF04.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAF04 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')" -ApiVersion beta - $tenantValue = ($result.keyRestrictions.isEnforced).ToString() + $tenantValue = $result.keyRestrictions.isEnforced | Out-String -NoNewLine $testResult = $tenantValue -eq 'true' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAF05.ps1 b/powershell/public/eidsca/Test-MtEidscaAF05.ps1 index 87cb323f..df952173 100644 --- a/powershell/public/eidsca/Test-MtEidscaAF05.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAF05.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAF05 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')" -ApiVersion beta - $tenantValue = ($result.keyRestrictions.aaGuids -notcontains $null).ToString() + $tenantValue = $result.keyRestrictions.aaGuids -notcontains $null | Out-String -NoNewLine $testResult = $tenantValue -eq 'true' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAF06.ps1 b/powershell/public/eidsca/Test-MtEidscaAF06.ps1 index 41ef7962..8fe04d3e 100644 --- a/powershell/public/eidsca/Test-MtEidscaAF06.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAF06.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAF06 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Fido2')" -ApiVersion beta - $tenantValue = ($result.keyRestrictions.aaGuids -notcontains $null -and ($result.keyRestrictions.enforcementType -eq 'allow' -or $result.keyRestrictions.enforcementType -eq 'block')).ToString() + $tenantValue = $result.keyRestrictions.aaGuids -notcontains $null -and ($result.keyRestrictions.enforcementType -eq 'allow' -or $result.keyRestrictions.enforcementType -eq 'block') | Out-String -NoNewLine $testResult = $tenantValue -eq 'true' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAG01.ps1 b/powershell/public/eidsca/Test-MtEidscaAG01.ps1 index 688d2053..13e410b4 100644 --- a/powershell/public/eidsca/Test-MtEidscaAG01.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAG01.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAG01 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy" -ApiVersion beta - $tenantValue = ($result.policyMigrationState).ToString() + $tenantValue = $result.policyMigrationState | Out-String -NoNewLine $testResult = $tenantValue -eq 'migrationComplete' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAG02.ps1 b/powershell/public/eidsca/Test-MtEidscaAG02.ps1 index a5f929a7..fcb39284 100644 --- a/powershell/public/eidsca/Test-MtEidscaAG02.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAG02.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAG02 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy" -ApiVersion beta - $tenantValue = ($result.reportSuspiciousActivitySettings.state).ToString() + $tenantValue = $result.reportSuspiciousActivitySettings.state | Out-String -NoNewLine $testResult = $tenantValue -eq 'enabled' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAG03.ps1 b/powershell/public/eidsca/Test-MtEidscaAG03.ps1 index 961dcdf6..a573c824 100644 --- a/powershell/public/eidsca/Test-MtEidscaAG03.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAG03.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAG03 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy" -ApiVersion beta - $tenantValue = ($result.reportSuspiciousActivitySettings.includeTarget.id).ToString() + $tenantValue = $result.reportSuspiciousActivitySettings.includeTarget.id | Out-String -NoNewLine $testResult = $tenantValue -eq 'all_users' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAM01.ps1 b/powershell/public/eidsca/Test-MtEidscaAM01.ps1 index 5cf71eda..310ddb98 100644 --- a/powershell/public/eidsca/Test-MtEidscaAM01.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAM01.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAM01 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')" -ApiVersion beta - $tenantValue = ($result.state).ToString() + $tenantValue = $result.state | Out-String -NoNewLine $testResult = $tenantValue -eq 'enabled' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAM02.ps1 b/powershell/public/eidsca/Test-MtEidscaAM02.ps1 index 33e5c77b..78b9474d 100644 --- a/powershell/public/eidsca/Test-MtEidscaAM02.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAM02.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAM02 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')" -ApiVersion beta - $tenantValue = ($result.state).ToString() + $tenantValue = $result.state | Out-String -NoNewLine $testResult = $tenantValue -eq 'enabled' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAM03.ps1 b/powershell/public/eidsca/Test-MtEidscaAM03.ps1 index 9820b3e7..975bcde5 100644 --- a/powershell/public/eidsca/Test-MtEidscaAM03.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAM03.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAM03 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')" -ApiVersion beta - $tenantValue = ($result.featureSettings.numberMatchingRequiredState.state).ToString() + $tenantValue = $result.featureSettings.numberMatchingRequiredState.state | Out-String -NoNewLine $testResult = $tenantValue -eq 'enabled' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAM04.ps1 b/powershell/public/eidsca/Test-MtEidscaAM04.ps1 index 7d311dc8..d8f7734b 100644 --- a/powershell/public/eidsca/Test-MtEidscaAM04.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAM04.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAM04 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')" -ApiVersion beta - $tenantValue = ($result.featureSettings.numberMatchingRequiredState.includeTarget.id).ToString() + $tenantValue = $result.featureSettings.numberMatchingRequiredState.includeTarget.id | Out-String -NoNewLine $testResult = $tenantValue -eq 'all_users' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAM06.ps1 b/powershell/public/eidsca/Test-MtEidscaAM06.ps1 index 2fd234be..aac55983 100644 --- a/powershell/public/eidsca/Test-MtEidscaAM06.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAM06.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAM06 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')" -ApiVersion beta - $tenantValue = ($result.featureSettings.displayAppInformationRequiredState.state).ToString() + $tenantValue = $result.featureSettings.displayAppInformationRequiredState.state | Out-String -NoNewLine $testResult = $tenantValue -eq 'enabled' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAM07.ps1 b/powershell/public/eidsca/Test-MtEidscaAM07.ps1 index bfdcf8a9..383ec37c 100644 --- a/powershell/public/eidsca/Test-MtEidscaAM07.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAM07.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAM07 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')" -ApiVersion beta - $tenantValue = ($result.featureSettings.displayAppInformationRequiredState.includeTarget.id).ToString() + $tenantValue = $result.featureSettings.displayAppInformationRequiredState.includeTarget.id | Out-String -NoNewLine $testResult = $tenantValue -eq 'all_users' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAM09.ps1 b/powershell/public/eidsca/Test-MtEidscaAM09.ps1 index 9f6b2559..a8c51a06 100644 --- a/powershell/public/eidsca/Test-MtEidscaAM09.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAM09.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAM09 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')" -ApiVersion beta - $tenantValue = ($result.featureSettings.displayLocationInformationRequiredState.state).ToString() + $tenantValue = $result.featureSettings.displayLocationInformationRequiredState.state | Out-String -NoNewLine $testResult = $tenantValue -eq 'enabled' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAM10.ps1 b/powershell/public/eidsca/Test-MtEidscaAM10.ps1 index ce38f100..48642185 100644 --- a/powershell/public/eidsca/Test-MtEidscaAM10.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAM10.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAM10 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')" -ApiVersion beta - $tenantValue = ($result.featureSettings.displayLocationInformationRequiredState.includeTarget.id).ToString() + $tenantValue = $result.featureSettings.displayLocationInformationRequiredState.includeTarget.id | Out-String -NoNewLine $testResult = $tenantValue -eq 'all_users' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAP01.ps1 b/powershell/public/eidsca/Test-MtEidscaAP01.ps1 index 9783031d..ee439201 100644 --- a/powershell/public/eidsca/Test-MtEidscaAP01.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAP01.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAP01 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authorizationPolicy" -ApiVersion beta - $tenantValue = ($result.allowedToUseSSPR).ToString() + $tenantValue = $result.allowedToUseSSPR | Out-String -NoNewLine $testResult = $tenantValue -eq 'true' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAP04.ps1 b/powershell/public/eidsca/Test-MtEidscaAP04.ps1 index 403140e5..0bac306c 100644 --- a/powershell/public/eidsca/Test-MtEidscaAP04.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAP04.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAP04 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authorizationPolicy" -ApiVersion beta - $tenantValue = ($result.allowInvitesFrom).ToString() + $tenantValue = $result.allowInvitesFrom | Out-String -NoNewLine $testResult = $tenantValue -eq 'adminsAndGuestInviters' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAP05.ps1 b/powershell/public/eidsca/Test-MtEidscaAP05.ps1 index 8c913de6..1659c5ae 100644 --- a/powershell/public/eidsca/Test-MtEidscaAP05.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAP05.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAP05 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authorizationPolicy" -ApiVersion beta - $tenantValue = ($result.allowedToSignUpEmailBasedSubscriptions).ToString() + $tenantValue = $result.allowedToSignUpEmailBasedSubscriptions | Out-String -NoNewLine $testResult = $tenantValue -eq 'false' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAP06.ps1 b/powershell/public/eidsca/Test-MtEidscaAP06.ps1 index 01f58ccb..ccdfb352 100644 --- a/powershell/public/eidsca/Test-MtEidscaAP06.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAP06.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAP06 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authorizationPolicy" -ApiVersion beta - $tenantValue = ($result.allowEmailVerifiedUsersToJoinOrganization).ToString() + $tenantValue = $result.allowEmailVerifiedUsersToJoinOrganization | Out-String -NoNewLine $testResult = $tenantValue -eq 'false' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAP07.ps1 b/powershell/public/eidsca/Test-MtEidscaAP07.ps1 index a35f2495..7c9b0261 100644 --- a/powershell/public/eidsca/Test-MtEidscaAP07.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAP07.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAP07 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authorizationPolicy" -ApiVersion beta - $tenantValue = ($result.guestUserRoleId).ToString() + $tenantValue = $result.guestUserRoleId | Out-String -NoNewLine $testResult = $tenantValue -eq '2af84b1e-32c8-42b7-82bc-daa82404023b' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAP08.ps1 b/powershell/public/eidsca/Test-MtEidscaAP08.ps1 index f7f85c8a..187bc137 100644 --- a/powershell/public/eidsca/Test-MtEidscaAP08.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAP08.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAP08 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authorizationPolicy" -ApiVersion beta - $tenantValue = ($result.permissionGrantPolicyIdsAssignedToDefaultUserRole | Sort-Object -Descending | select-object -first 1).ToString() + $tenantValue = $result.permissionGrantPolicyIdsAssignedToDefaultUserRole | Sort-Object -Descending | select-object -first 1 | Out-String -NoNewLine $testResult = $tenantValue -eq 'ManagePermissionGrantsForSelf.microsoft-user-default-low' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAP09.ps1 b/powershell/public/eidsca/Test-MtEidscaAP09.ps1 index d2f390fe..a4c44881 100644 --- a/powershell/public/eidsca/Test-MtEidscaAP09.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAP09.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAP09 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authorizationPolicy" -ApiVersion beta - $tenantValue = ($result.allowUserConsentForRiskyApps).ToString() + $tenantValue = $result.allowUserConsentForRiskyApps | Out-String -NoNewLine $testResult = $tenantValue -eq 'false' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAP10.ps1 b/powershell/public/eidsca/Test-MtEidscaAP10.ps1 index 18035b7f..28af25a6 100644 --- a/powershell/public/eidsca/Test-MtEidscaAP10.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAP10.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAP10 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authorizationPolicy" -ApiVersion beta - $tenantValue = ($result.defaultUserRolePermissions.allowedToCreateApps).ToString() + $tenantValue = $result.defaultUserRolePermissions.allowedToCreateApps | Out-String -NoNewLine $testResult = $tenantValue -eq 'false' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAP14.ps1 b/powershell/public/eidsca/Test-MtEidscaAP14.ps1 index 36fabaf5..c21759f6 100644 --- a/powershell/public/eidsca/Test-MtEidscaAP14.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAP14.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAP14 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authorizationPolicy" -ApiVersion beta - $tenantValue = ($result.defaultUserRolePermissions.allowedToReadOtherUsers).ToString() + $tenantValue = $result.defaultUserRolePermissions.allowedToReadOtherUsers | Out-String -NoNewLine $testResult = $tenantValue -eq 'true' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAT01.ps1 b/powershell/public/eidsca/Test-MtEidscaAT01.ps1 index a7bb1ed7..f25206b1 100644 --- a/powershell/public/eidsca/Test-MtEidscaAT01.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAT01.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAT01 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('TemporaryAccessPass')" -ApiVersion beta - $tenantValue = ($result.state).ToString() + $tenantValue = $result.state | Out-String -NoNewLine $testResult = $tenantValue -eq 'enabled' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAT02.ps1 b/powershell/public/eidsca/Test-MtEidscaAT02.ps1 index 9a5dc783..bceebc8e 100644 --- a/powershell/public/eidsca/Test-MtEidscaAT02.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAT02.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAT02 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('TemporaryAccessPass')" -ApiVersion beta - $tenantValue = ($result.isUsableOnce).ToString() + $tenantValue = $result.isUsableOnce | Out-String -NoNewLine $testResult = $tenantValue -eq 'false' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaAV01.ps1 b/powershell/public/eidsca/Test-MtEidscaAV01.ps1 index ddf54fb5..f615ef37 100644 --- a/powershell/public/eidsca/Test-MtEidscaAV01.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaAV01.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaAV01 { $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Voice')" -ApiVersion beta - $tenantValue = ($result.state).ToString() + $tenantValue = $result.state | Out-String -NoNewLine $testResult = $tenantValue -eq 'disabled' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaCP01.ps1 b/powershell/public/eidsca/Test-MtEidscaCP01.ps1 index ad2c8296..87cb4012 100644 --- a/powershell/public/eidsca/Test-MtEidscaCP01.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaCP01.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaCP01 { $result = Invoke-MtGraphRequest -RelativeUri "settings" -ApiVersion beta - $tenantValue = ($result.values | where-object name -eq 'EnableGroupSpecificConsent' | select-object -expand value).ToString() + $tenantValue = $result.values | where-object name -eq 'EnableGroupSpecificConsent' | select-object -expand value | Out-String -NoNewLine $testResult = $tenantValue -eq 'False' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaCP03.ps1 b/powershell/public/eidsca/Test-MtEidscaCP03.ps1 index 1ae33fa7..8a5b9f84 100644 --- a/powershell/public/eidsca/Test-MtEidscaCP03.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaCP03.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaCP03 { $result = Invoke-MtGraphRequest -RelativeUri "settings" -ApiVersion beta - $tenantValue = ($result.values | where-object name -eq 'BlockUserConsentForRiskyApps' | select-object -expand value).ToString() + $tenantValue = $result.values | where-object name -eq 'BlockUserConsentForRiskyApps' | select-object -expand value | Out-String -NoNewLine $testResult = $tenantValue -eq 'true' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaCP04.ps1 b/powershell/public/eidsca/Test-MtEidscaCP04.ps1 index b6eb921c..5e70c5d0 100644 --- a/powershell/public/eidsca/Test-MtEidscaCP04.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaCP04.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaCP04 { $result = Invoke-MtGraphRequest -RelativeUri "settings" -ApiVersion beta - $tenantValue = ($result.values | where-object name -eq 'EnableAdminConsentRequests' | select-object -expand value).ToString() + $tenantValue = $result.values | where-object name -eq 'EnableAdminConsentRequests' | select-object -expand value | Out-String -NoNewLine $testResult = $tenantValue -eq 'true' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaCR01.ps1 b/powershell/public/eidsca/Test-MtEidscaCR01.ps1 index 6b37235c..2cdd41c3 100644 --- a/powershell/public/eidsca/Test-MtEidscaCR01.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaCR01.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaCR01 { $result = Invoke-MtGraphRequest -RelativeUri "policies/adminConsentRequestPolicy" -ApiVersion beta - $tenantValue = ($result.isEnabled).ToString() + $tenantValue = $result.isEnabled | Out-String -NoNewLine $testResult = $tenantValue -eq 'true' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaCR02.ps1 b/powershell/public/eidsca/Test-MtEidscaCR02.ps1 index 2c1e2146..e1a79735 100644 --- a/powershell/public/eidsca/Test-MtEidscaCR02.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaCR02.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaCR02 { $result = Invoke-MtGraphRequest -RelativeUri "policies/adminConsentRequestPolicy" -ApiVersion beta - $tenantValue = ($result.notifyReviewers).ToString() + $tenantValue = $result.notifyReviewers | Out-String -NoNewLine $testResult = $tenantValue -eq 'true' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaCR03.ps1 b/powershell/public/eidsca/Test-MtEidscaCR03.ps1 index 54fdf319..1ba3765d 100644 --- a/powershell/public/eidsca/Test-MtEidscaCR03.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaCR03.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaCR03 { $result = Invoke-MtGraphRequest -RelativeUri "policies/adminConsentRequestPolicy" -ApiVersion beta - $tenantValue = ($result.notifyReviewers).ToString() + $tenantValue = $result.notifyReviewers | Out-String -NoNewLine $testResult = $tenantValue -eq 'true' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaCR04.ps1 b/powershell/public/eidsca/Test-MtEidscaCR04.ps1 index 595b2586..2d39fd61 100644 --- a/powershell/public/eidsca/Test-MtEidscaCR04.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaCR04.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaCR04 { $result = Invoke-MtGraphRequest -RelativeUri "policies/adminConsentRequestPolicy" -ApiVersion beta - $tenantValue = ($result.requestDurationInDays).ToString() + $tenantValue = $result.requestDurationInDays | Out-String -NoNewLine $testResult = $tenantValue -eq '30' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaPR01.ps1 b/powershell/public/eidsca/Test-MtEidscaPR01.ps1 index 2b018d4d..228e3da0 100644 --- a/powershell/public/eidsca/Test-MtEidscaPR01.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaPR01.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaPR01 { $result = Invoke-MtGraphRequest -RelativeUri "settings" -ApiVersion beta - $tenantValue = ($result.values | where-object name -eq 'BannedPasswordCheckOnPremisesMode' | select-object -expand value).ToString() + $tenantValue = $result.values | where-object name -eq 'BannedPasswordCheckOnPremisesMode' | select-object -expand value | Out-String -NoNewLine $testResult = $tenantValue -eq 'Enforce' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaPR02.ps1 b/powershell/public/eidsca/Test-MtEidscaPR02.ps1 index 1b09e6e8..164fabd5 100644 --- a/powershell/public/eidsca/Test-MtEidscaPR02.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaPR02.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaPR02 { $result = Invoke-MtGraphRequest -RelativeUri "settings" -ApiVersion beta - $tenantValue = ($result.values | where-object name -eq 'EnableBannedPasswordCheckOnPremises' | select-object -expand value).ToString() + $tenantValue = $result.values | where-object name -eq 'EnableBannedPasswordCheckOnPremises' | select-object -expand value | Out-String -NoNewLine $testResult = $tenantValue -eq 'True' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaPR03.ps1 b/powershell/public/eidsca/Test-MtEidscaPR03.ps1 index 07de4b0f..10ef8306 100644 --- a/powershell/public/eidsca/Test-MtEidscaPR03.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaPR03.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaPR03 { $result = Invoke-MtGraphRequest -RelativeUri "settings" -ApiVersion beta - $tenantValue = ($result.values | where-object name -eq 'EnableBannedPasswordCheck' | select-object -expand value).ToString() + $tenantValue = $result.values | where-object name -eq 'EnableBannedPasswordCheck' | select-object -expand value | Out-String -NoNewLine $testResult = $tenantValue -eq 'True' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaPR05.ps1 b/powershell/public/eidsca/Test-MtEidscaPR05.ps1 index 415ccf8f..15493aac 100644 --- a/powershell/public/eidsca/Test-MtEidscaPR05.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaPR05.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaPR05 { $result = Invoke-MtGraphRequest -RelativeUri "settings" -ApiVersion beta - $tenantValue = ($result.values | where-object name -eq 'LockoutDurationInSeconds' | select-object -expand value).ToString() + $tenantValue = $result.values | where-object name -eq 'LockoutDurationInSeconds' | select-object -expand value | Out-String -NoNewLine $testResult = $tenantValue -eq '60' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaPR06.ps1 b/powershell/public/eidsca/Test-MtEidscaPR06.ps1 index dd36b53a..3fb2eff0 100644 --- a/powershell/public/eidsca/Test-MtEidscaPR06.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaPR06.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaPR06 { $result = Invoke-MtGraphRequest -RelativeUri "settings" -ApiVersion beta - $tenantValue = ($result.values | where-object name -eq 'LockoutThreshold' | select-object -expand value).ToString() + $tenantValue = $result.values | where-object name -eq 'LockoutThreshold' | select-object -expand value | Out-String -NoNewLine $testResult = $tenantValue -eq '10' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaST08.ps1 b/powershell/public/eidsca/Test-MtEidscaST08.ps1 index d6e4534e..ffc51701 100644 --- a/powershell/public/eidsca/Test-MtEidscaST08.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaST08.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaST08 { $result = Invoke-MtGraphRequest -RelativeUri "settings" -ApiVersion beta - $tenantValue = ($result.values | where-object name -eq 'AllowGuestsToBeGroupOwner' | select-object -expand value).ToString() + $tenantValue = $result.values | where-object name -eq 'AllowGuestsToBeGroupOwner' | select-object -expand value | Out-String -NoNewLine $testResult = $tenantValue -eq 'false' if($testResult){ diff --git a/powershell/public/eidsca/Test-MtEidscaST09.ps1 b/powershell/public/eidsca/Test-MtEidscaST09.ps1 index 6a145cd8..bd172d07 100644 --- a/powershell/public/eidsca/Test-MtEidscaST09.ps1 +++ b/powershell/public/eidsca/Test-MtEidscaST09.ps1 @@ -23,7 +23,7 @@ Function Test-MtEidscaST09 { $result = Invoke-MtGraphRequest -RelativeUri "settings" -ApiVersion beta - $tenantValue = ($result.values | where-object name -eq 'AllowGuestsToAccessGroups' | select-object -expand value).ToString() + $tenantValue = $result.values | where-object name -eq 'AllowGuestsToAccessGroups' | select-object -expand value | Out-String -NoNewLine $testResult = $tenantValue -eq 'True' if($testResult){