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
@@ -84,12 +81,12 @@ function Invoke-CIPPStandardAutopilotProfile {
84
81
# Remediate if the state is not correct
85
82
if ($Settings.remediate-eq$true) {
86
83
if ($StateIsCorrect-eq$true) {
87
-
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Autopilot profile '$($DisplayName)' already exists"-sev Info
84
+
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Autopilot profile '$($Settings.DisplayName)' already exists"-sev Info
88
85
} else {
89
86
try {
90
87
$Parameters=@{
91
88
tenantFilter=$Tenant
92
-
displayName=$DisplayName
89
+
displayName=$Settings.DisplayName
93
90
description=$Settings.Description
94
91
userType=$userType
95
92
DeploymentMode=$DeploymentMode
@@ -106,9 +103,9 @@ function Invoke-CIPPStandardAutopilotProfile {
106
103
107
104
Set-CIPPDefaultAPDeploymentProfile@Parameters
108
105
if ($null-eq$CurrentConfig) {
109
-
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Created Autopilot profile '$($DisplayName)'"-sev Info
106
+
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Created Autopilot profile '$($Settings.DisplayName)'"-sev Info
110
107
} else {
111
-
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Updated Autopilot profile '$($DisplayName)'"-sev Info
108
+
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Updated Autopilot profile '$($Settings.DisplayName)'"-sev Info
112
109
}
113
110
} catch {
114
111
$ErrorMessage=Get-CippException-Exception $_
@@ -128,10 +125,10 @@ function Invoke-CIPPStandardAutopilotProfile {
128
125
# Alert
129
126
if ($Settings.alert-eq$true) {
130
127
if ($StateIsCorrect-eq$true) {
131
-
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Autopilot profile '$($DisplayName)' exists"-sev Info
128
+
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Autopilot profile '$($Settings.DisplayName)' exists"-sev Info
132
129
} else {
133
-
Write-StandardsAlert-message "Autopilot profile '$($DisplayName)' do not match expected configuration"-object $CurrentConfig-tenant $Tenant-standardName 'AutopilotProfile'-standardId $Settings.standardId
134
-
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Autopilot profile '$($DisplayName)' do not match expected configuration"-sev Info
130
+
Write-StandardsAlert-message "Autopilot profile '$($Settings.DisplayName)' do not match expected configuration"-object $CurrentConfig-tenant $Tenant-standardName 'AutopilotProfile'-standardId $Settings.standardId
131
+
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Autopilot profile '$($Settings.DisplayName)' do not match expected configuration"-sev Info
0 commit comments