0

I am using the PowerShell Community Extensions (PSCX), but one one particular job we are having to zip up several files before transmitting to our hosted server.

using: Write-Zip -IncludeEmptyDirectories -OutputPath $outputZip -Path $currentLocalPath generates a progress bar that floats over the command console lines for each zip generated (in this particular job 61), and hides the messages being logged to screen behind.

I have tried:

Write-Progress "Done" "Done" -completed

but that does not clear the progress bar of the zip process.

We do log to a file so there is no issue of missing anything, I was hoping for an option that would tidy up Write-Zip after each progress without losing and feedback details on the screen.

-Quiet is the only option I can see that will stop this behaviour, but then the user would be wondering what is going on until each file completes.

Luke Duddridge
  • 4,285
  • 35
  • 50
  • I'm sorry, but I don't understand what you want to do here. Does Write-Zip leave a progress bar over the screen and you want to hide it? Please be a bit more specific about what is happening, and what you want to happen. – FoxDeploy Apr 30 '15 at 12:43
  • Write-Zip generates the progress-bar, when the process finishes the bar is left, after each file is successfully zipped, I want to clear that progress bar from the screen to free up the real estate. – Luke Duddridge Apr 30 '15 at 15:39

1 Answers1

0

You can add a cls to your script when the Zip actions are finished. This will clear your screen to get rid of the artifacts.

CLS is actually an alias of Clear-Host, if you'd like to use the full cmdlet.

Will this be sufficient for your needs or do you want to do something else as well?

FoxDeploy
  • 12,569
  • 2
  • 33
  • 48
  • `cls` will clear everything, I was hoping to retain the information written to screen during the process and although `Progress-Bar` has a `-Complete` parameter that cleared it from the screen, it looks like the `PSCX ` library does not overload that. – Luke Duddridge May 01 '15 at 07:50