Package source to IntuneWin with the Microsoft Win32 Content Prep Tool: https://github.com/microsoft/Microsoft-Win32-Content-Prep-Tool
IntuneWinAppUtil.exe -c 'Source' -s 'Source\Move-DownloadsFolderToOnedrive.ps1' -o 'Package'
Install command: PowerShell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File "Move-DownloadsFolderToOnedrive.ps1" -OneDriveOrgName "%OrgName%" Uninstall cmdlet: PowerShell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File "Move-DownloadsFolderToUserProfile.ps1"
Replace "%OrgName%" with your organization's OneDriveOrgName. for example: -OneDriveOrgName "Contoso".
Custom detection script: Detect-DownloadsFolderToOneDrive.ps1
Modify the detection script and replace "%OrgName%" with your organization's OneDriveOrgName.