Need to build a GUI progress bar for import-pssession

Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by Profile photo of Don Jones Don Jones 2 weeks ago.

  • Author
    Posts
  • #72190
    Profile photo of Deepak Verma
    Deepak Verma
    Participant

    Hi experts,

    I am writing a GUI tool where I'm importing an Microsoft Exchange PowerShell session using import-pssession. I want to show the progress of import in a GUI progress bar. By default import-possession uses write-progress to show progress in console, which I don't want and disabled using $ProgressPreference = 'SilentlyContinue'.

    But not getting any clue on this on how to get the progress in INT.

    Please help.

  • #72424
    Profile photo of Don Jones
    Don Jones
    Keymaster

    That's hard coded functionality in Import-Module and Import-PSSession; you're not going to be able to do what you're asking.

    • #72476
      Profile photo of Deepak Verma
      Deepak Verma
      Participant

      Thanks for the reply Don. But I'm wondering that how powershell_ise and sapien PowerShell studio are able to display the progress.

      I have taken the screenshot of powershell_ise but I don't know how to paste screenshot here.

  • #72494
    Profile photo of Don Jones
    Don Jones
    Keymaster

    Those applications host the shell and respond to Write-Progress. You can't do that from within the shell.

You must be logged in to reply to this topic.