windowspowershellcompress-archive

Windows-Powershell Compress-Archive: Whats the process order?


I have a simple "error.log" compression script and wanted to know in what order the Windows Powershell "Compress-Archive" command performs its actions, specifically when you move the compressed file to another Drive. So if i have

$compress = @{
    LiteralPath = $SourceDir
    DestinationPath = $TagetZip
}

Compress-Archive @compress

$TargetZip being on a "remote" drive (e.g. a very slow external HDD), will it first compress, then move? Does it stream stuff directly to the remote? Worst case would be if it copied the files to the remote first and compressed after.


Solution

  • Compress-Archive create archive using your swap file and RAM memory , then move it to destination.