There is no current way to download existing Powershell Scripts Uploaded to Intune Device Management. To do this you have to use the graph API. There is a Demo called : DeviceManagementScripts_Get.ps1 , however it wasn’t working for me , so I created the below
This downloads a Single Script for you , it asks you for the id ( shows you each linked to the file name )
[pastacode lang=”markup” user=”pariswells” repos=”public-code” path_id=”DownloadSingleIntunepowershellScript.ps1″ revision=”” highlight=”” lines=”” provider=”github”/]
This downloads all the Scripts in your InTune Directory
[pastacode lang=”markup” user=”pariswells” repos=”public-code” path_id=”DownloadAllInTunePowershellFiles.ps1″ revision=”” highlight=”” lines=”” provider=”github”/]