5

I have a script that does two things (so far). Download a ZIP file from a web server to my desktop, and then unzip it. The download part works perfectly. The unzip part uses the 'Expand-Archive' cmdlet. I would like to hide the progress message for the 'Expand-Archive' cmdlet.

So far, for the unzip, I have this and it doesn't seem to work:

$progressPreference = 'SilentlyContinue'
Expand-Archive c:\Users\Administrator\Desktop\<filename>.zip -DestinationPath C:\Users\Administrator\Desktop\

It unzips just fine, but shows the blue and yellow progress indicators that I would prefer to hide.

csdivine
  • 51
  • 1
  • 4
  • 1
    I figured it out. I had to set the 'ProgressPreference' environment variable in the 'Microsoft.PowerShell_profile.ps1' file (following instructions here: https://www.howtogeek.com/50236/customizing-your-powershell-profile/) then RESTART my Powershell session for the new environment variable to be picked-up. After that, the Expand-Archive command worked as expected, hiding the progress indicator. – csdivine Sep 15 '17 at 21:53
  • 8
    You need to use `$global:ProgressPreference = 'SilentlyContinue'` – Lukas Cenovsky Apr 18 '18 at 13:42

0 Answers0