Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinTegelaar committed Aug 23, 2024
1 parent c28130b commit fe55184
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Modules/CIPPCore/Public/Invoke-CIPPOffboardingJob.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function Invoke-CIPPOffboardingJob {
if (!$options.keepcopy) {
Set-CIPPForwarding -userid $userid -username $username -tenantFilter $Tenantfilter -Forward $Options.forward -ExecutingUser $ExecutingUser -APIName $APIName
} else {
Set-CIPPForwarding -userid $userid -username $username -tenantFilter $Tenantfilter -Forward $Options.forward -KeepCopy [boolean]$Options.keepCopy -ExecutingUser $ExecutingUser -APIName $APIName
Set-CIPPForwarding -userid $userid -username $username -tenantFilter $Tenantfilter -Forward $Options.forward -KeepCopy [boolean]($Options.keepCopy) -ExecutingUser $ExecutingUser -APIName $APIName
}
}
{ $_.'RemoveLicenses' -eq 'true' } {
Expand Down
3 changes: 3 additions & 0 deletions Modules/CIPPCore/Public/Set-CIPPIntunePolicy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ function Set-CIPPIntunePolicy {
$CheckExististing = New-GraphGETRequest -uri "https://graph.microsoft.com/beta/deviceAppManagement/$TemplateTypeURL" -tenantid $tenantFilter
if ($displayname -in $CheckExististing.displayName) {
$PostType = 'edited'
$ExistingID = $CheckExististing | Where-Object -Property displayName -EQ $displayname
$CreateRequest = New-GraphPOSTRequest -uri "https://graph.microsoft.com/beta/deviceAppManagement/$TemplateTypeURL/$($ExistingID.Id)" -tenantid $tenantFilter -type PATCH -body $RawJSON
$CreateRequest = $CheckExististing | Where-Object -Property displayName -EQ $DisplayName
} else {
Expand All @@ -36,6 +37,7 @@ function Set-CIPPIntunePolicy {
if ($displayname -in $CheckExististing.displayName) {
$RawJSON = ConvertTo-Json -InputObject ($JSON | Select-Object * -ExcludeProperty 'scheduledActionsForRule') -Depth 20 -Compress
$PostType = 'edited'
$ExistingID = $CheckExististing | Where-Object -Property displayName -EQ $displayname
$CreateRequest = New-GraphPOSTRequest -uri "https://graph.microsoft.com/beta/deviceManagement/$TemplateTypeURL/$($ExistingID.Id)" -tenantid $tenantFilter -type PATCH -body $RawJSON
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -tenant $($tenantFilter) -message "Updated policy $($DisplayName) to template defaults" -Sev 'info'
$CreateRequest = $CheckExististing | Where-Object -Property displayName -EQ $DisplayName
Expand Down Expand Up @@ -111,6 +113,7 @@ function Set-CIPPIntunePolicy {
$CheckExististing = New-GraphGETRequest -uri "https://graph.microsoft.com/beta/deviceManagement/$TemplateTypeURL" -tenantid $tenantFilter
if ($DisplayName -in $CheckExististing.name) {
$PostType = 'edited'
$ExistingID = $CheckExististing | Where-Object -Property displayName -EQ $displayname
$CreateRequest = New-GraphPOSTRequest -uri "https://graph.microsoft.com/beta/deviceManagement/$TemplateTypeURL/$($ExistingID.Id)" -tenantid $tenantFilter -type PUT -body $RawJSON
$CreateRequest = $CheckExististing | Where-Object -Property displayName -EQ $DisplayName

Expand Down

0 comments on commit fe55184

Please sign in to comment.