$rootImageDir = "D:\Downloads\The Last of Us Remastered v1.09 by MorpheusGames\Extracted\Image0\build\ps4\main" $items= Get-ChildItem -Path $rootImageDir -Filter *.psarc -Recurse -File $toolPath = "C:\Program Files (x86)\SCE\ORBIS SDKs\4.500\host_tools\bin\orbis-psarc.exe" foreach($arc in $items){ $arcPath = $arc.FullName $arcDir = $arc.DirectoryName $name = [System.IO.Path]::GetFileNameWithoutExtension($arcPath) $name = "$($name)_psarc" $extractDir = Join-Path $arcDir $name Write-Host "Extracting $arcPath to $extractDir" &$toolPath extract -y --to $extractDir $arcPath }