Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do I hide the last Write-Progress message?

74 views
Skip to first unread message

Roman Kuzmin

unread,
Oct 11, 2006, 6:19:02 AM10/11/06
to
Perhaps I miss something very obvious but how do I hide the last
Write-Progress message if I do not need it any more and my script still works
(and displays some data on the screen itself)?

--
Thanks,
Roman

Alex K. Angelopoulos [MVP]

unread,
Oct 11, 2006, 1:13:43 PM10/11/06
to
Have you tried to reset the ProgressPreference variable to Continue within
the script?

This is a wild guess, since I don't know details about what your script is
showing. :)

"Roman Kuzmin" <Roman...@discussions.microsoft.com> wrote in message
news:EC4EEA62-A2E7-4368...@microsoft.com...

James Truher

unread,
Oct 11, 2006, 1:35:13 PM10/11/06
to
use the -completed switch:

write-progress one one
start-sleep 3
write-progress one one -completed
start-sleep 3

--
--
James Truher [MSFT]
Windows PowerShell Development
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.

"Roman Kuzmin" <Roman...@discussions.microsoft.com> wrote in message
news:EC4EEA62-A2E7-4368...@microsoft.com...

Roman Kuzmin

unread,
Oct 11, 2006, 1:38:58 PM10/11/06
to
"Alex K. Angelopoulos [MVP]" wrote

> I don't know details about what your script is showing.

This is my script (don't paste it into console, it should be really a
script, not 2 separate commands):

# Now I need to display progress
1..100 | %{sleep -m 10; write-progress Processing Foo -perc $_}
# Now I don't want to see the last progress message
1..10 | %{sleep 1; Write-Host "I don't want to see progress now $_"}

Any ideas how to hide progress for the second part of the script?

--
Thanks,
Roman


Roman Kuzmin

unread,
Oct 11, 2006, 1:46:36 PM10/11/06
to
It does not work for my script:
(don't paste it into console, it should be really a script, not separate
commands)

1..100 | %{sleep -m 10; write-progress Processing Foo -perc $_}

write-progress one one -completed
1..10 | %{Write-Host "Don't want to see progress now $_"; sleep 1}

--
Thanks,
Roman


James Truher

unread,
Oct 11, 2006, 1:55:10 PM10/11/06
to
i'd say you've found a bug

--
--
James Truher [MSFT]
Windows PowerShell Development
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.

"Roman Kuzmin" <z@z.z> wrote in message
news:eFHt10V7...@TK2MSFTNGP05.phx.gbl...

0 new messages