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

Wrapping PowerShell Scripts In A GUI Interface

359 views
Skip to first unread message

GregHMI

unread,
Sep 20, 2007, 4:20:07 PM9/20/07
to
I am fairly new to PowerShell and was looking for a way to take the scripts I
have created in PowerShell and provide a nice GUI interface for our end
users. For example, a screen which would perhaps have a nice GUI that would
ask for an end users response, or a button that would launch a PowerShell
script to find all of the disabled users in AD. In our company, we have some
power users who don't mind seeing command line responses, but there is also a
great number who have come to expect a nice crisp screen, with focussed menu
viewing areas to respond to, or to find valuable data. One of the answers I
found when working with VB scripting was using the HTML Application, where
you can create a nice GUI for user commands, or responses, (see the article
in Microsoft Technet, "Extreme Makeover: Wrap Your Scripts Up in a GUI
interface",
http://www.microsoft.com/technet/scriptcenter/topics/htas/tutorial1.mspx

It would be nice to see this same type of approach with PowerShell. Any
ideas if this can be done with PowerShell?

Anybody's help would be much appreciated.

Thanks -

Karl Mitschke

unread,
Sep 20, 2007, 4:57:30 PM9/20/07
to
Hello GregHMI,

Take a look at this:

http://www.codeproject.com/useritems/HowToRunPowerShell.asp

Karl


RichS

unread,
Sep 21, 2007, 4:42:00 AM9/21/07
to
have a look at PowerGUI

www.powergui.org
--
Richard Siddaway
Please note that all scripts are supplied "as is" and with no warranty
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk

Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Hal Rottenberg

unread,
Sep 21, 2007, 12:54:32 PM9/21/07
to
GregHMI wrote:
> Thanks Rich! I did look at PowerGUI, I found it great for developing in, but
> I really wanted something simple that could easily be distributed to an
> average end user. Almost like VB scripting allows for simple INPUT boxes and
> then I could invoke the PowerShell script to return that answer.

You might want to look a little further at PowerGUI for these reasons:

1. You can distribute your scripts, script nodes etc. as a snapin which can be
easily imported into someone's copy of PowerGUI
2. You can organize the scripts into folders, sort of making your own
application collection.

Now I need to go read that HTA article you mentioned. :)

--

Hal Rottenberg
Blog: http://halr9000.com
Webmaster, Psi (http://psi-im.org)
Co-host, PowerScripting Podcast (http://powerscripting.net)

Hal Rottenberg

unread,
Sep 21, 2007, 1:17:45 PM9/21/07
to
GregHMI wrote:
> viewing areas to respond to, or to find valuable data. One of the answers I
> found when working with VB scripting was using the HTML Application, where
> you can create a nice GUI for user commands, or responses, (see the article
> in Microsoft Technet, "Extreme Makeover: Wrap Your Scripts Up in a GUI
> interface",
> http://www.microsoft.com/technet/scriptcenter/topics/htas/tutorial1.mspx
>
> It would be nice to see this same type of approach with PowerShell. Any
> ideas if this can be done with PowerShell?

You know what would be really cool?

<html>
<head>
<title>test</title>
<HTA:APPLICATION
APPLICATIONNAME="test"
SCROLL="yes"
SINGLEINSTANCE="yes"
>
</head>
<body>
<script language="PowerShell">
Get-Process
</script>
</body>
</html>

Does anyone know if such a thing is feasible? What kinda code would need to be
written to make this happen, if it is feasible? Big project? Little project?

Brandon Shell

unread,
Sep 21, 2007, 1:24:00 PM9/21/07
to
You could something similar using Windows Forms and XML parsing, but I would
guess that would be a big project.

"Hal Rottenberg" <h...@halr9000.com> wrote in message
news:empZUNH$HHA....@TK2MSFTNGP04.phx.gbl...

RichS

unread,
Sep 21, 2007, 3:42:03 PM9/21/07
to
Given the opening statement of the thread I think Forms\XML would be a huge
leap

--
Richard Siddaway
Please note that all scripts are supplied "as is" and with no warranty
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk

Brandon Shell

unread,
Sep 21, 2007, 3:54:16 PM9/21/07
to
That response was towards Hal's question about HTA for powershell.

"RichS" <Ri...@discussions.microsoft.com> wrote in message
news:166B4DB9-34CD-423E...@microsoft.com...

Jean

unread,
Sep 21, 2007, 4:26:12 PM9/21/07
to
> Wrap Your Scripts Up in a GUI
> interface",
> http://www.microsoft.com/technet/scriptcenter/topics/htas/tutorial1.mspx
>
> It would be nice to see this same type of approach with PowerShell. Any
> ideas if this can be done with PowerShell?

Just FYI I'd put a script sample here : http://www.psscript.net
illustrating communication between PS and HTA (see new-IENamed.ps1,
PowerShell.HTA and HTA_PowerShell.ps1).

Regards,

--
Jean - JMST
Belgium


GregHMI

unread,
Sep 21, 2007, 4:32:03 PM9/21/07
to
Marco,

Thanks that really helps. This is getting me closer. It would be nice to
be a part of the PowerShell script.

Greg

"Marco Shaw" wrote:

> GregHMI wrote:
> > Thanks Rich! I did look at PowerGUI, I found it great for developing in, but
> > I really wanted something simple that could easily be distributed to an
> > average end user. Almost like VB scripting allows for simple INPUT boxes and
> > then I could invoke the PowerShell script to return that answer.
>

> http://www.primalscript.com/Free_Tools/index.asp
>
> They created an input box.
>
> You can also create something simple from PowerShell directly:
>
> http://www.microsoft.com/technet/scriptcenter/topics/winpsh/convert/inputbox.mspx
>
> There are some other methods too, but a few don't work so well on
> non-Vista (the input box appears *behind* the current shell).
>
> Marco
>
>
> --
> ----------------
> PowerGadgets MVP
> http://www.powergadgets.com/mvp
>
> Blog:
> http://marcoshaw.blogspot.com
>

GregHMI

unread,
Sep 21, 2007, 4:34:02 PM9/21/07
to
Karl,

That information was helpful. Let us know if your approach to the HTA model
gets us further. I wish you the best on your approach. Thanks again.

Greg

"Karl Mitschke" wrote:

> Hello Greg,
>
> > Karl,
> >
> > Thanks for the information. I am not as familar with C# programming,
> > but that is very close to what I was looking for. Perhaps I won't be
> > able to find something like I mentioned in the Technet article:
> > http://www.microsoft.com/technet/scriptcenter/topics/htas/tutorial1.ms
> > px
> >
> > I may need to get more creative and try working with the information
> > you gave me.
> >
> > Thanks -
> >
> > Greg
>
> That link I provided will give you the code you need to place behind the
> hta application in the link you peovided.
>
> I am thinking of changing my whole approach to the hta model, because of
> your link.
>
> Karl
>
>
>

GregHMI

unread,
Sep 21, 2007, 4:36:05 PM9/21/07
to
Hal,

I agree with the HTA solution. That would be great. I guess that is where
I was originally headed, but it doesn't look posible. Thanks for your help.

Greg

GregHMI

unread,
Sep 21, 2007, 4:46:03 PM9/21/07
to
Jean,

That was pretty neat. I appreciate your sharing of that information.

Greg

0 new messages