Skip to content

Commit 1ff1f6f

Browse files
Merge pull request KelvinTegelaar#1620 from kris6673/intune-script-perms
Fix: Intune script permission issues
2 parents 626056e + de6bb05 commit 1ff1f6f

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Endpoint/MEM/Invoke-EditIntuneScript.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ function Invoke-EditIntuneScript {
7373
}
7474
'PATCH' {
7575
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
76-
StatusCode = [HttpStatusCode]::BadRequest
77-
Body = "Method $($Request.Method) is not supported."
78-
})
76+
StatusCode = [HttpStatusCode]::BadRequest
77+
Body = "Method $($Request.Method) is not supported."
78+
})
7979
}
8080
'POST' {
8181
# Parse the script data to determine type

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Endpoint/MEM/Invoke-RemoveIntuneScript.ps1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ function Invoke-RemoveIntuneScript {
3535
'Linux' {
3636
"https://graph.microsoft.com/beta/deviceManagement/ConfigurationPolicies('$($ID)')"
3737
}
38-
Default { $null }
38+
default { $null }
3939
}
4040

4141
$null = New-GraphPOSTRequest -uri $URI -type DELETE -tenantid $TenantFilter
4242
$Result = "Deleted $($ScriptType) script $($DisplayName) with ID: $($ID)"
43-
Write-LogMessage -headers $.Headers -API $APINAME -tenant $Tenant -message $Result -Sev 'Info'
43+
Write-LogMessage -headers $Headers -API $APINAME -tenant $Tenant -message $Result -Sev 'Info'
4444
$StatusCode = [HttpStatusCode]::OK
4545
} catch {
4646
$ErrorMessage = Get-CippException -Exception $_
@@ -49,11 +49,10 @@ function Invoke-RemoveIntuneScript {
4949
$StatusCode = [HttpStatusCode]::Forbidden
5050
}
5151

52-
$body = [pscustomobject]@{'Results' = "$Result" }
5352
# Associate values to output bindings by calling 'Push-OutputBinding'.
5453
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
5554
StatusCode = $StatusCode
56-
Body = $body
55+
Body = @{'Results' = "$Result" }
5756
})
5857

5958
}

Modules/CIPPCore/Public/SAMManifest.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@
9191
"id": "9255e99d-faf5-445e-bbf7-cb71482737c4",
9292
"type": "Role"
9393
},
94+
{
95+
"id": "8b9d79d0-ad75-4566-8619-f7500ecfcebe",
96+
"type": "Scope"
97+
},
9498
{
9599
"id": "06a5fe6d-c49d-46a7-b082-56b1b14103c7",
96100
"type": "Role"

0 commit comments

Comments
 (0)