#Requires -RunAsAdministrator # Do not install any firmware packages before using this script $basePathX86 = "C:\Program Files (x86)\Motorola" $basePath64 = "C:\Program Files\Motorola" $upgradePathX86 = Join-Path $basePathX86 "MOTOTRBO Upgrade Packages\update" $deviceUpdateCPSX86 = Join-Path $basePathX86 "MOTOTRBO CPS\deviceupdate" $deviceUpdateCPS64 = Join-Path $basePath64 "MOTOTRBO CPS\deviceupdate" $upgradePath64 = Join-Path $basePath64 "MOTOTRBO Upgrade Packages\update" # Helper: Create folder if it doesn't exist function Ensure-Directory($path) { if (-not (Test-Path $path)) { New-Item -ItemType Directory -Path $path -Force | Out-Null } } # Helper: Create junction (mklink /d equivalent) function Ensure-Junction($link, $target) { if (-not (Test-Path $link)) { New-Item -Path $link -ItemType Junction -Target $target | Out-Null } } # Step 1: Create required folders Ensure-Directory $upgradePathX86 Ensure-Directory $deviceUpdateCPSX86 Ensure-Directory $deviceUpdateCPS64 Ensure-Directory (Split-Path $upgradePath64) # Step 2: Create symbolic links Ensure-Junction (Join-Path $deviceUpdateCPSX86 "update") $upgradePathX86 Ensure-Junction (Join-Path $deviceUpdateCPS64 "update") $upgradePathX86 Ensure-Junction $upgradePath64 $upgradePathX86