Use PowerShell Background Jobs to handle the data gathering on separate
threads. Better yet, use PowerShell Remoting *with* Background Jobs to handle
data gathering. Offload the work onto the remote hosts.
Invoke-Command -ComputerName rds01, rds02, rds03, rdsgw01 -ScriptBlock {
gather-data; } -AsJob;
Cheers,
Trevor Sullivan
Microsoft PowerShell MVP
-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Michael Leone
Sent: Thursday, October 2, 2014 12:26 PM
To: [email protected]; [email protected]
Subject: [powershell] Powershell - how to display a msgbox with no buttons
So I have my script that pulls information from my RDS servers, and shows it as
a listbox onscreen. Kewl!
But ... (you knew there had to be one, right?)
The script takes a while to construct that listbox (basically, I need to do
query all the RDS servers for the list of running process for any of my
published RemoteApps [6]), and doing all those "Get-WmiObject" calls takes a
while). So what I want to do is display a message - "Hang on, it'll be done
soon". But I want it to just display until the listbox is ready, then go away.
I figure I would display that as soon as the script function to gather the
information starts, and I want to clear it, as soon as I have enough
information to fill the real listbox. Basically, an equivalent to the hourglass
that is displayed when Windows is busy doing something ...
And I don't know enough .Net to know how to do that ... Oh, I can find numerous
examples of showing a MsgBox, but they all have a "OK" button that the user is
supposed to press, to make it go away. And that's not what I want ..
If someone could tell me exactly what sort of search terms I should be using,
or a pointer to an example script that puts up a msgbox, and then removes the
msgbox without user action, that would be ideal.
Thanks. Sorry to keep asking so many questions.
================================================
Did you know you can also post and find answers on PowerShell in the forums?
http://www.myitforum.com/forums/default.asp?catApp=1
================================================
Did you know you can also post and find answers on PowerShell in the forums?
http://www.myitforum.com/forums/default.asp?catApp=1