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

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

  • Author
    Posts
  • #62623

    Mark
    Participant

    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

    nimms
    Participant

    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.