Created
December 17, 2014 17:22
-
-
Save rbocchinfuso/9794307ab476f0d67468 to your computer and use it in GitHub Desktop.
PowerShell Script to Merge NAR Files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#mergenar.ps1 | |
$TempFile = "c:\temp\nar_out\Temp.nar" | |
$OutputFile = "c:\temp\nar_out\NAR_Merge.nar" | |
$NarFiles = Get-Childitem "c:\temp\nar_in" | |
$count =0 | |
$count = $NarFiles | Measure-Object | select -ExpandProperty count | |
$filecount = 0 | |
foreach($NFile in $NarFiles){ | |
$pcomplete = $filecount / $count * 100 | |
if($filecount -eq 0){Copy-Item $NFile.FullName $OutputFile}Else{ | |
Write-Progress -Activity "Working..." -PercentComplete $pcomplete -CurrentOperation "$pcomplete% complete" -Status "Please wait." | |
Copy-Item $OutputFile $TempFile | |
Remove-Item $OutputFile | |
#write "Merging $OutputFile with $TempFile" | |
NaviSECCli.exe analyzer -archivemerge -data $TempFile $NFile.FullName -out $OutputFile | Out-Null | |
} | |
$filecount ++ | |
$count++ | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment