$currentPath = [Environment]::GetEnvironmentVariable("Path", "Machine") if ($currentPath -notlike "*$directory*") [Environment]::SetEnvironmentVariable("Path", "$currentPath;$directory", "Machine") Write-Host "✓ Added $directory to system PATH (restart required)" -ForegroundColor Green
& $SapcarPath -xvf $archive.FullName -R $extractPath Download Sapcar.exe
SAPCAR requires a valid SAP Service Marketplace account. The script provides manual download instructions since SAP doesn't allow direct automated downloads without proper authentication. $currentPath = [Environment]::GetEnvironmentVariable("Path"
if ($downloadUrl) $success = Invoke-SAPCARDownload -url $downloadUrl -outputPath $exePath if (-not $success) Write-Error "Failed to download SAPCAR" exit 1 [string] $OutputDir = "."
if (-not (Test-Path $exePath)) return $false
$wrapperPath = Join-Path $toolsDir "Extract-SAPArchive.ps1" $wrapperContent = @" param( [Parameter(Mandatory)] [string] $ArchivePath, [string] $OutputDir = ".", [switch]`$List )