Need to build a GUI progress bar for import-pssession

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.

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

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.

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