← Free Scripts | Diagnostics |PowerShell

Recover Intune Platform Script Content the Portal Will Not Show You

Once a platform script is uploaded, Intune will not let you view it. This script pulls the body back through Microsoft Graph and saves it as a .ps1 file.

Intune platform scripts cannot be viewed or copied from the portal once they are uploaded, so if the original is lost, the only supported way to get the body back is through Microsoft Graph.

This script connects to Graph, lists the platform scripts in your tenant, and decodes the one you ask for. With no parameters it lists every platform script with its Id and name; with -ScriptId or -Name it prints the decoded body; and with -Path it saves each decoded script to a .ps1 file. It is read-only.

Download Get-Platform_Script_Contents.ps1 from the PowerStacks intune-scripts repository:

GitHub
Microsoft GraphPlatform scriptsRecovery

Want simplified Intune reporting?

PowerStacks BI for Intune and App Store for Intune do the heavy lifting, all inside your own tenant, with nothing leaving it.