Skip to content

Commit

Permalink
Merge pull request okieselbach#15 from shenanbe/patch-1
Browse files Browse the repository at this point in the history
Update Get-DeviceManagementScripts.ps1
  • Loading branch information
okieselbach authored Sep 21, 2022
2 parents b97e891 + e83a507 commit 85abe4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Get-DeviceManagementScripts.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Get-DeviceManagementScripts -FolderPath C:\temp -FileName myScript.ps1
$result = Invoke-MSGraphRequest -Url "$graphUrl/deviceManagement/deviceManagementScripts" -HttpMethod GET

if ($FileName){
$scriptIds = $result.value | Select-Object id,fileName | Where-Object -Property fileName -eq $FileName
$scriptId = $result.value | Select-Object id,fileName | Where-Object -Property fileName -eq $FileName
$script = Invoke-MSGraphRequest -Url "$graphUrl/deviceManagement/deviceManagementScripts/$($scriptId.id)" -HttpMethod GET
[System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String($($script.scriptContent))) | Out-File -Encoding ASCII -FilePath $(Join-Path $FolderPath $($script.fileName))
}
Expand Down

0 comments on commit 85abe4f

Please sign in to comment.