views:

51

answers:

1

my script uses two forms. i want to close second form after opening first one. how can i do it?

+1  A: 

PowerShell has a built-in mechanism to report progress - a cmdlet called Write-Progress. Give it a try:

for ($i = 0; $i -le 100; $i +=5)
{
    Write-Progress -Activity "Collecting ERP data" -Status "Downloading..." `
                   -PercentComplete $i
    Start-Sleep -Seconds 1
}
Keith Hill
thank you. that's cool cmdlet. how do i know when i stopped collecting data?
Varyanica
I don't know enough about your particular scenario but presumably when the web service call returns you're done collecting data, right? At that point, you can make the Write-Progress display disappear by calling `Write-Progress -Activity "Collecting ERP data" -Status "Downloading..." -Completed`.
Keith Hill
thank you. it helped. i should read mans more thoroughly.
Varyanica