Incorporating write-progress into this script
hi,
hope can help. i'm starting grips powershell scripting , have simple script here virtual directory information exchange. because of exchange servers in different sites, of commands take little while , i'd add write-progress each of commands can't head round how it. can helpw? script below.
$file1 ="c:\ps\after\vds.txt" write-output "getting ews virtual directories" get-webservicesvirtualdirectory | select-object name,server,internalurl,externalurl | fl | out-file $file1 write-output "getting owa virtual directories" get-owavirtualdirectory | select name,server,internalurl,externalurl | fl | out-file $file1 -append write-output "getting ecp virtual directories" get-ecpvirtualdirectory | select name,server,internalurl,externalurl | fl | out-file $file1 -append write-output "getting activesync virtual directories" get-activesyncvirtualdirectory | select name,server,internalurl,externalurl | fl | out-file $file1 -append write-output "getting oab virtual directories" get-oabvirtualdirectory | select name,server,internalurl,externalurl | fl | out-file $file1 -append write-output "all done"
in advance...
well issue write-progress need aware of how many things have able make right estimate.
so need run in loop can increment. way have set show progress base on tell him.
read article more information
https://technet.microsoft.com/en-us/library/ff730943.aspx
Windows Server > Windows PowerShell
Comments
Post a Comment