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/GraphHelper/Get-NormalizedError.ps1
+8-7Lines changed: 8 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@ function Get-NormalizedError {
3
3
.FUNCTIONALITY
4
4
Internal
5
5
#>
6
+
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingEmptyCatchBlock','', Justification ='CIPP does not use this function to catch errors')]
6
7
[CmdletBinding()]
7
8
param (
8
9
[string]$message
@@ -21,16 +22,16 @@ function Get-NormalizedError {
21
22
22
23
#We need to check if the message is in one of these fields, and if so, return it.
'*User was not found.*' { 'The relationship between this tenant and the partner has been dissolved from the tenant side.' }
47
48
'*AADSTS50020*' { 'AADSTS50020: The user you have used for your Secure Application Model is a guest in this tenant, or your are using GDAP and have not added the user to the correct group. Please delete the guest user to gain access to this tenant' }
48
49
'*AADSTS50177' { 'AADSTS50177: The user you have used for your Secure Application Model is a guest in this tenant, or your are using GDAP and have not added the user to the correct group. Please delete the guest user to gain access to this tenant' }
49
-
'*invalid or malformed*' { 'The request is malformed. Have you finished the SAM Setup?' }
50
+
'*invalid or malformed*' { 'The request is malformed. Have you finished the Setup Wizard' }
50
51
'*Windows Store repository apps feature is not supported for this tenant*' { 'This tenant does not have WinGet support available' }
51
52
'*AADSTS650051*' { 'The application does not exist yet. Try again in 30 seconds.' }
52
53
'*AppLifecycle_2210*' { 'Failed to call Intune APIs: Does the tenant have a license available?' }
@@ -58,15 +59,15 @@ function Get-NormalizedError {
'*Your tenant is not licensed for this feature.*' { 'Required license not available for this tenant' }
60
61
'*AADSTS65001*' { 'We cannot access this tenant as consent has not been given, please try refreshing the CPV permissions in the application settings menu.' }
61
-
'*AADSTS700082*' { 'The CIPP user access token has expired. Run the SAM Setup wizard to refresh your tokens.' }
62
+
'*AADSTS700082*' { 'The CIPP user access token has expired. Run the Setup Wizard to refresh your tokens.' }
62
63
'*Account is not provisioned.' { 'The account is not provisioned. You do not the correct M365 license to access this information..' }
63
64
'*AADSTS5000224*' { 'This resource is not available - Has this tenant been deleted?' }
64
65
'*AADSTS53003*' { 'Access has been blocked by Conditional Access policies. Please check the Conditional Access configuration documentation' }
65
66
'*AADSTS900023*' { 'This tenant is not available for this operation. Please check the selected tenant and try again.' }
66
67
'*AADSTS9002313*' { 'The credentials used to connect to the Graph API are not available, please retry. If this issue persists you may need to execute the SAM wizard.' }
67
68
'*One or more platform(s) is/are not configured for the customer. Please configure the platform before trying to purchase a SKU.*' { 'One or more platform(s) is/are not configured for the customer. Please configure the platform before trying to purchase a SKU.' }
68
69
"One or more added object references already exist for the following modified properties: 'members'." { 'This user is already a member of the selected group.' }
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Autopilot profile '$($Settings.DisplayName)' exists"-sev Info
120
+
if ($Settings.alert-eq$true) {
121
+
if ($StateIsCorrect-eq$true) {
122
+
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Autopilot profile '$($DisplayName)' exists"-sev Info
121
123
} else {
122
-
Write-StandardsAlert-message "Autopilot profile '$($Settings.DisplayName)' do not match expected configuration"-object $CurrentConfig-tenant $Tenant-standardName 'AutopilotProfile'-standardId $Settings.standardId
123
-
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Autopilot profile '$($Settings.DisplayName)' do not match expected configuration"-sev Info
124
+
Write-StandardsAlert-message "Autopilot profile '$($DisplayName)' do not match expected configuration"-object $CurrentConfig-tenant $Tenant-standardName 'AutopilotProfile'-standardId $Settings.standardId
125
+
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Autopilot profile '$($DisplayName)' do not match expected configuration"-sev Info
0 commit comments