Here is a Pretty Good Copy OSD Logs Script for ConfigMgr (SCCM) and instructions on how to add it. The script will generate a Zip archive of OSD-related logs and upload it to a file share.
Credits: Authenticate and ZipFiles functions from Johan Schrewelius (@josch62).
The Script
Download link: https://github.com/DeploymentResearch/DRFiles/blob/master/Scripts/ConfigMgr/Invoke-PGCopyOSDLogs.ps1
The script is using the following variables:
- SLShare: UNC Path to shared folder
- LogCopyUsername: User name to connect to shared folder
- LogCopyPassword: Password for the LogCopyUsername user
Adding the script to a "Module" task sequence
Step 1: Add a Set Dynamic Variables action and add the required script variables.

Step 2: Add a Run PowerShell Script action and paste the script in the "Enter a PowerShell script" option.
Note: It's also totally fine to add the script to a package and reference that package in the task sequence, but since the script is small, I find it easier to embed it.

The resulting archive on the defined shared folder:

Thanks for this great script, but there's a small error. A double backslash in the Panther\\UnattendGC paths, causing script to fail.
Thank you! Updated