Write-Progress does not show in package SAPIEN PowerShell V5 Host (Command Line)

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 11 months and 2 days old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
djs191
Posts: 1
Last visit: Thu Dec 07, 2023 5:55 am

Write-Progress does not show in package SAPIEN PowerShell V5 Host (Command Line)

Post by djs191 »

Product, version and build: PowerShell Studio 2023, 5.8.221.0
Operating system: W10
PowerShell version(s): 5.1

When I Build Package as 'SAPIEN PowerShell V5 Host (Command Line)' the Write-Progress output does not display when I run the package.

The Write-Progress does show if I just run the script in the SAPIEN PowerShell Studio 2023.

It also shows if I package it as 'Microsoft Windows PowerShell (Command Line)'.
by Alexander Riedel » Tue Apr 25, 2023 1:52 pm
That is as intended. Write-Progress is a PowerShell console specific thing.
When you run it from PowerShell Studio, there is a helper in the host showing write-progress messages.
If you package with 'Microsoft Windows PowerShell (Command Line)' it runs a temporary file in an actual PowerShell console.
Packaging with 'SAPIEN PowerShell V5 Host (Command Line)' creates a console process that must run properly in a cmd console, from a task schedule, as a background process of something else etc.
So anything that is not stdout, stderr or stdin is suppressed.
Go to full post
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Write-Progress does not show in package SAPIEN PowerShell V5 Host (Command Line)

Post by Alexander Riedel »

That is as intended. Write-Progress is a PowerShell console specific thing.
When you run it from PowerShell Studio, there is a helper in the host showing write-progress messages.
If you package with 'Microsoft Windows PowerShell (Command Line)' it runs a temporary file in an actual PowerShell console.
Packaging with 'SAPIEN PowerShell V5 Host (Command Line)' creates a console process that must run properly in a cmd console, from a task schedule, as a background process of something else etc.
So anything that is not stdout, stderr or stdin is suppressed.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 11 months and 2 days old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.