Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

How do I hide the last Write-Progress message?

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 10-11-2006   #1 (permalink)
Roman Kuzmin
Guest


 

How do I hide the last Write-Progress message?

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

My System SpecsSystem Spec
Old 10-11-2006   #2 (permalink)
Alex K. Angelopoulos [MVP]
Guest


 

Re: How do I hide the last Write-Progress message?

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" <RomanKuzmin@discussions.microsoft.com> wrote in message
news:EC4EEA62-A2E7-4368-87F9-638881C4FCCE@microsoft.com...
> 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



My System SpecsSystem Spec
Old 10-11-2006   #3 (permalink)
James Truher
Guest


 

Re: How do I hide the last Write-Progress message?

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" <RomanKuzmin@discussions.microsoft.com> wrote in message
news:EC4EEA62-A2E7-4368-87F9-638881C4FCCE@microsoft.com...
> 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



My System SpecsSystem Spec
Old 10-11-2006   #4 (permalink)
Roman Kuzmin
Guest


 

Re: How do I hide the last Write-Progress message?

"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


My System SpecsSystem Spec
Old 10-11-2006   #5 (permalink)
Roman Kuzmin
Guest


 

Re: How do I hide the last Write-Progress message?

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


My System SpecsSystem Spec
Old 10-11-2006   #6 (permalink)
James Truher
Guest


 

Re: How do I hide the last Write-Progress message?

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:eFHt10V7GHA.4552@TK2MSFTNGP05.phx.gbl...
> 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
>



My System SpecsSystem Spec
Closed Thread
Update your Vista Drivers Update Your Drivers Now!!

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Write-Progress for ONE cmdlet bLumEisoN PowerShell 1 04-30-2008 09:32 AM
Changing the 'o' character used in Write-Progress? Duncan Smith PowerShell 3 12-17-2007 12:13 PM
Understanding Write-Progress with in foreach deadmeatdave@gmail.com PowerShell 1 01-03-2007 10:10 AM
Write-Progress while Copying Files? fixitchris PowerShell 1 12-21-2006 11:45 AM
Asyncronous Write-Progress Staffan Gustafsson PowerShell 0 06-05-2006 04:12 PM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51