This article will briefly discuss how to export a ConfigMgr OSD task sequence.
The SMS_TaskSequencePackage class has a lazy property named Sequence which contains the XML for the task sequence. Because this is a lazy property, we must obtain a reference to each WMI instance using its direct path, before we can open the property’s value. Once we have the XML for the task sequence, we can send it off to a text file. The PowerShell code to do that would look like this:
$TsList = Get-WmiObject SMS_TaskSequencePackage -Namespace rootsmssite_lab
ForEach ($Ts in $TsList)
$Ts = [wmi]”$($Ts.__PATH)”
Set-Content -Path “$($ts.PackageId).xml” -Value $Ts.Sequence