Copy-Item -ToSession progress bar. How to turn off?

This topic contains 1 reply, has 2 voices, and was last updated by  nimms 10 months, 3 weeks ago.

  • Author
  • #62623


    Is there a way to suppress the progress bar that appears when using Copy-Item cmdlet with -ToSession switch? I have my own custom progress bar in script and these blinking pop-up windows are useless and annoying when copying a large amount of small files over PSRemoting session.

  • #62625


    Hello, Mark!
    There is the $ProgressPreference variable, you can learn more about it in:

    Get-Help about_Preference_Variables

    So you can do this:

    $ProgressPreference = 'SilentlyContinue' # hide the progress bar
    # ...your code...
    $ProgressPreference = 'Continue' # restore the default value if you need

You must be logged in to reply to this topic.