In this very short post I will show how you get your uploaded Intune PowerShell scripts again. If you work with Intune and especially with Intune PowerShell scripts to configure Windows 10 devices you probably looked at this dialog and wondered why you are not able to edit or download your already uploaded script again.

During consulting work I often don’t have access to the original script files for review or modifications. This might be because there was no repository to maintain these uploaded scripts, or they got lost on the file server :-). Whatever the reason was for missing script files, this situation happens quite often. Also during migrations it can be handy to export scripts for re-import into another tenant.
I have written a small PowerShell script to download all the scripts to a specified folder again. In case you need an individual script it supports a FileName parameter to download just one specific PowerShell script.
The function uses the Intune PowerShell SDK:
It is super easy to use, just call it with the FolderPath parameter to download all PowerShell Scripts:
Get-DeviceManagementScripts -FolderPath C:\temp
Or you specify the FileName parameter to download the individual script:
Get-DeviceManagementScripts -FolderPath C:\temp -FileName HideFileExt.ps1
Your specified folder will give you access to all your scripts or just the individual one you specified:

The complete script can be found here:
https://github.com/okieselbach/Intune/blob/master/Get-DeviceManagementScripts.ps1
I hope it helps some people with lost original scripts or consultants without access to the original files. It can also be handy during tenant to tenant migrations.
Happy downloading!
Thanks Oliver, just needed it this week but had to use a ‘competitor’ script π
that command doesnt exist in the 6.1907.1.0 (current version)
Oh really, I need to verify that and modify it to work again… give me some time to verify.
best,
Oliver
Did use this script just now which installed graph 6.1907.1.0, could use it without any issues. Nice for exporting PowerShell scripts for people who don’t use GitHub to store and version them π