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

Welcome Forums General PowerShell Q&A Copy-Item -ToSession progress bar. How to turn off?

This topic contains 1 reply, has 2 voices, and was last updated by

 
Participant
2 years, 3 months ago.

  • Author
    Posts
  • #62623

    Participant
    Topics: 6
    Replies: 8
    Points: 0
    Rank: Member

    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

    Participant
    Topics: 0
    Replies: 10
    Points: 0
    Rank: Member

    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

The topic ‘Copy-Item -ToSession progress bar. How to turn off?’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort