Hello, I have a problem where the progress bar will display from the Backup-SqlDatabase command which I execute via the Invoke-Command cmdlet. The problem is the progress bar displays just fine when I am running my PowerShell project from within PowerShell Studio 2020. However it does not display at all when I run the .exe generated by building the PowerShell project.
Any help would be appreciated!
Displaying progress bar from Backup-SqlDatabase function via Invoke-Command
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- timstspry17
- Posts: 45
- Last visit: Tue Apr 18, 2023 2:49 pm
Re: Displaying progress bar from Backup-SqlDatabase function via Invoke-Command
The progress bar requires a UI. It's display would depend on the type of EXE you are building.
In forms script the ProgressBar should display normally as a GUI ProgressBar.
When running in an Invoke-Command the progress bar will not display because the command is run remotely.
The backup command does not require remoting. It is a SQLServer command that is designed to run locally and do its own connection to any server instance in the network. When run this way the ProgressBar should display normally.
In forms script the ProgressBar should display normally as a GUI ProgressBar.
When running in an Invoke-Command the progress bar will not display because the command is run remotely.
The backup command does not require remoting. It is a SQLServer command that is designed to run locally and do its own connection to any server instance in the network. When run this way the ProgressBar should display normally.
- timstspry17
- Posts: 45
- Last visit: Tue Apr 18, 2023 2:49 pm
Re: Displaying progress bar from Backup-SqlDatabase function via Invoke-Command
Thank you jvierra. That did the trick, although I'm not quite sure why packaging with "Saping PowerShell V5 Host )Windows Form did not function the same way, especially since I am using a form as the main point of my app.