Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7532847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:34:17+00:00 2026-05-30T05:34:17+00:00

Can anyone help me troubleshoot why this PSCX cmdlet ‘Write-Zip’ is so slow? It

  • 0

Can anyone help me troubleshoot why this PSCX cmdlet ‘Write-Zip’ is so slow? It takes 1.5 hours when the DotNetZip library can ZIP the same folders in about 20 minutes. (The issue with the DotNetZip library is that it chokes with large files, so I switched over to PSCX which is perfect, cool little progress bar and it actually works too, just very slowly).

Here is some sample code, let me know if you need to see anything else.

    $ElapsedTime = [System.Diagnostics.Stopwatch]::StartNew()

    Write-Host "Script Started at $(get-date)"

    Import-Module Pscx
    Import-Module BitsTransfer

    Write-Host "Just imported the BitsTransfer and Pscx modules"

    Write-Host "*** Starting backup portion of script ***"

    foreach($i in $appServers) {

            if (!(Test-Path -path \\$i\c$\newDeploy)) {
                New-Item \\$i\c$\newDeploy -type directory
                Write-Host "Just created newDeploy folder on $i"
            }
            if (!(Test-Path -path \\$i\c$\newDeploy\backup)) {
                New-Item \\$i\c$\newDeploy\backup -type directory
                Write-Host "Just created newDeploy\backup folder on $i"
            }
            if(!(Test-Path \\$i\c$\newDeploy\zipper.ps1)) {
                Start-BitsTransfer -Source \\$appDeployServer\c$\newDeploy\zipper.ps1 -Destination \\$i\c$\newDeploy
                Write-host "Just added zipper.ps1 to $i"
            }

    }

    foreach($i in $appServers) {

        $sessionForI = New-PSSession -computername $i
        Invoke-Command -Session $sessionForI -ArgumentList  $aosFolder, $i, $ElapsedTime -ScriptBlock {
            param ($aosFolder, $i, $ElapsedTime)

            Import-Module Pscx
            Write-Host "Just imported Pscx module for $i"

            if ((Test-Path C:\\newDeploy\\backup\\$aosFolder.zip)) {
                Remove-Item C:\\newDeploy\\backup\\$aosFolder.zip
                Write-Host "Just removed newDeploy\backup\$aosFolder.zip on $i"
            }

            Write-Host "Just started creating new ZIP file backup created on $i"
            Write-Host "   Elapsed Time: $($ElapsedTime.Elapsed.ToString())"

            cd "C:\Program Files (x86)\Folder\$aosFolder"
            Get-ChildItem "C:\Program Files (x86)\Folder\$aosFolder" -Recurse -Exclude *.e2e | Write-Zip -OutputPath "C:\newDeploy\backup\$aosFolder.zip" -NoClobber -Level 1

            write-host "   Elapsed Time: $($ElapsedTime.Elapsed.ToString())"
            Write-Host "Just finished creating new ZIP file backup created on $i"
        }
        remove-PSSession -session $sessionForI

    }

    Write-Host "Just ran second foreach loop to ZIP all folders to backup on each server"

    foreach($i in $appServers) {
        if(!(Test-Path -path C:\newDeploy\backup\$i)) {
            New-Item C:\newDeploy\backup\$i -type directory
            Write-Host "Just created DEPLOY SERVER's newDeploy\backup\$i folder for backups"
        }
        Start-BitsTransfer -Source \\$i\c$\newDeploy\backup\$aosFolder.zip -Destination C:\newDeploy\backup\$i
        Write-Host "$i backup ZIP transferred to deploy server"
    }

    Write-Host "Just ran third foreach loop to move all ZIP files to the backup server for each remote server"

    foreach($i in $appServers) {
        Remove-Item \\$i\c$\newDeploy\backup\$aosFolder.zip
        Write-Host "Just removed newDeploy\backup\$aosFolder.zip on $i"
    }

    Write-Host "Just ran forth foreach loop to delete all backup ZIP files to cleanup"

    $date = get-date -format "M-d-yyyy"
    Write-Zip -Path "C:\newDeploy\backup" -OutputPath "C:\newDeploy\backup\$date APPbackup.zip" -NoClobber -Level 1
    Write-Host "Just ran final ZIP command to put all server's backups into one neat ZIP"

    foreach($i in $appServers) {
        if((Test-Path -path C:\newDeploy\backup\$i)) {
            Remove-Item -Force -Recurse C:\newDeploy\backup\$i
            Write-Host "Just removed DEPLOY SERVER's newDeploy\backup\$i folder"
        }
    }
    Write-Host "Just ran fifth foreach loop to delete each server's backup folder on the local server to cleanup"

    Write-Host "*** Finished with backup portion of script ***"

    Write-Host "*** Starting deploy preparation portion of script ***"



    Write-Host "*** Finished with deploy preparation portion of script ***"

    Write-Host "Script Ended at $(get-date)"
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T05:34:18+00:00Added an answer on May 30, 2026 at 5:34 am

    I would recommend that you use the 7zip commandline archive tools. They are pretty snappy and can work with variety of archives.

    http://downloads.sourceforge.net/sevenzip/7za920.zip

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone help me with the trying to write SQL (MS SqlServer) - I
Can anyone help with with the time complexity of this algorithm, and why it
Can anyone help with this... vector<unsigned int> *vVec = new vector<unsigned int>; vVec .reserve(frankReservedSpace);
Can anyone help me figure this out? The below code works fine and gets
Can anyone help me to convert this to proper JavaScript? <script>var datePostForAll = &#39;<div
Can anyone help me on how i can achieve this style for android ?
Can anyone help me with this nonsense problem? <?php if(!readfile($path)) { $error = error_get_last();
Can anyone help me with this CAML query? When I flip the Ascending attribute
Can anyone help me with this error. It works when I try the first
Can anyone help me make sense of this error message? I wrote a drag

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.