Skip to content

Commit ae0a23e

Browse files
authored
Merge pull request KelvinTegelaar#1379 from Ren-Roros-Digital/CRLFtoLF
Invoke-EditIntuneScript.ps1 CRLF to LF
2 parents 4eef16c + b589711 commit ae0a23e

File tree

1 file changed

+48
-48
lines changed

1 file changed

+48
-48
lines changed
Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
1-
using namespace System.Net
2-
3-
function Invoke-EditIntuneScript {
4-
<#
5-
.FUNCTIONALITY
6-
Entrypoint
7-
.ROLE
8-
Endpoint.MEM.ReadWrite
9-
#>
10-
[CmdletBinding()]
11-
param($Request, $TriggerMetadata)
12-
13-
$APIName = $Request.Params.CIPPEndpoint
14-
$Headers = $Request.Headers
15-
Write-LogMessage -Headers $Headers -API $APINAME -message 'Accessed this API' -Sev Debug
16-
17-
$graphUrl = "https://graph.microsoft.com/beta"
18-
switch($Request.Method) {
19-
"GET" {
20-
$parms = @{
21-
uri = "$graphUrl/deviceManagement/deviceManagementScripts/$($Request.Query.ScriptId)"
22-
tenantid = $Request.Query.TenantFilter
23-
}
24-
25-
$intuneScript = New-GraphGetRequest @parms
26-
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
27-
StatusCode = [HttpStatusCode]::OK
28-
Body = $intuneScript
29-
})
30-
}
31-
"PATCH" {
32-
$parms = @{
33-
uri = "$graphUrl/deviceManagement/deviceManagementScripts/$($Request.Body.ScriptId)"
34-
tenantid = $Request.Body.TenantFilter
35-
body = $Request.Body.IntuneScript
36-
}
37-
$patchResult = New-GraphPOSTRequest @parms -type "PATCH"
38-
$body = [pscustomobject]@{'Results' = $patchResult }
39-
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
40-
StatusCode = [HttpStatusCode]::OK
41-
Body = $body
42-
})
43-
}
44-
"POST" {
45-
Write-Output "Adding script"
46-
}
47-
}
48-
}
1+
using namespace System.Net
2+
3+
function Invoke-EditIntuneScript {
4+
<#
5+
.FUNCTIONALITY
6+
Entrypoint
7+
.ROLE
8+
Endpoint.MEM.ReadWrite
9+
#>
10+
[CmdletBinding()]
11+
param($Request, $TriggerMetadata)
12+
13+
$APIName = $Request.Params.CIPPEndpoint
14+
$Headers = $Request.Headers
15+
Write-LogMessage -Headers $Headers -API $APINAME -message 'Accessed this API' -Sev Debug
16+
17+
$graphUrl = "https://graph.microsoft.com/beta"
18+
switch($Request.Method) {
19+
"GET" {
20+
$parms = @{
21+
uri = "$graphUrl/deviceManagement/deviceManagementScripts/$($Request.Query.ScriptId)"
22+
tenantid = $Request.Query.TenantFilter
23+
}
24+
25+
$intuneScript = New-GraphGetRequest @parms
26+
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
27+
StatusCode = [HttpStatusCode]::OK
28+
Body = $intuneScript
29+
})
30+
}
31+
"PATCH" {
32+
$parms = @{
33+
uri = "$graphUrl/deviceManagement/deviceManagementScripts/$($Request.Body.ScriptId)"
34+
tenantid = $Request.Body.TenantFilter
35+
body = $Request.Body.IntuneScript
36+
}
37+
$patchResult = New-GraphPOSTRequest @parms -type "PATCH"
38+
$body = [pscustomobject]@{'Results' = $patchResult }
39+
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
40+
StatusCode = [HttpStatusCode]::OK
41+
Body = $body
42+
})
43+
}
44+
"POST" {
45+
Write-Output "Adding script"
46+
}
47+
}
48+
}

0 commit comments

Comments
 (0)