Skip to Main Content
Status Under review
Product Area OSD Community Tools
Categories OSDCloud
Created by Patrick Davis
Created on May 14, 2026

Have OSDCloud add additional scripts to the C:\ drive for additional functionality in OOBE

We use this functionality to add helpful scripts for our Desktop Techs to run if needed in OOBE if they encounter issues during Autopilot or Provisioning. Here is an example of that the installs the 'Autopilot Diagnostics Community' script. We typically write these to the OSDCloud folder on C: root for easier access.


if (Test-Path 'C:\OSDCloud\') {

#AP.ps1 - Community Autopilot Diagnostics Script
$PSCodeAp = '
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted -Verbose
Install-Script -Name Get-AutopilotDiagnosticsCommunity -Verbose
Get-Module Microsoft.Graph.Intune -Verbose
Get-AutopilotDiagnosticsCommunity -Online -Verbose
'
New-Item -Path 'C:\OSDCloud\' -Name Ap.ps1 -Value "$PSCodeAp" -Force
}
  • Attach files