Author Posts

August 28, 2016 at 3:26 pm

Hello all !!

I've been powershelling for about a year, learning by myself and i found powershell 100% useful.

I will appreciate any suggestion regarding to know which do you think is the best web language to learn, so i can create a front end´s GUI that communicates with Powershell.

For example, creating a full Admin Manager (GUI) that creates, deletes, add, remove groups, add permissions to folders, etc...

I know exists Sapien's product, but is unreachable for me.

Thanks in advance !!!

August 28, 2016 at 8:53 pm

Learn C#.

As PowerShell is .NET framework underneath, any .NET supported language will do.

August 29, 2016 at 5:19 am

Thanks Arie, can it be too?

August 29, 2016 at 12:26 pm

You can build GUIs in powershell without c# or vb.

August 29, 2016 at 5:05 pm

You can build GUIs in powershell without c# or vb.

I know Sapien´s tool. But i am looking a cheaper tool.

August 29, 2016 at 5:12 pm

Notepad. The output from sapien is just powershell.

ex. you could write all this in notepad.. I used to:D

function Call-blank_psf {

	[void][reflection.assembly]::Load('System.Windows.Forms, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089')
	$form1 = New-Object 'System.Windows.Forms.Form'
	$button1 = New-Object 'System.Windows.Forms.Button'
	$InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState'
		#Correct the initial state of the form to prevent the .Net maximized form issue
		$form1.WindowState = $InitialFormWindowState
		catch [Exception]
		{ }
	$form1.AutoScaleDimensions = '6, 13'
	$form1.AutoScaleMode = 'Font'
	$form1.ClientSize = '284, 262'
	$form1.Name = 'form1'
	$form1.Text = 'Form'
	$button1.Location = '61, 73'
	$button1.Name = 'button1'
	$button1.Size = '75, 23'
	$button1.TabIndex = 0
	$button1.Text = 'button1'
	$button1.UseVisualStyleBackColor = $True

	$InitialFormWindowState = $form1.WindowState
	return $form1.ShowDialog()


Call-blank_psf | Out-Null

August 29, 2016 at 7:59 pm

Looks nice !

The thing was that i was searching for a tool that can handle in graphic way the GUI. So i can grab and put the combobox, textbox, button, ex with the mouse anywhere. And then, double-clicking in the objets, i can program the logic of each event.

Like in VB.

August 29, 2016 at 8:30 pm

Try PowerShell Studio from Sapien

August 29, 2016 at 8:35 pm

Try PowerShell Studio from Sapien

I´ve done it. But it´s too expensive to buy it for me.
I am searching another tool, the best compatible tool for creating GUIs and then write the code in powershell.

August 29, 2016 at 8:38 pm

I hear visual studio does it as well or it's in progress. Personally if you're looking for the best it's Sapien(it's built for powershell). Tons of other features people overlook such as exporting to exe, msi, source control, built in scripts for controls, remoting directly from the gui, etc. There is a free trial.

August 30, 2016 at 9:16 pm

I've built GUI's using Visual Studio 2015 (free community edition) and it's worked great. Very easy and relatively intuitive.

August 31, 2016 at 1:10 am

I've built GUI's using Visual Studio 2015 (free community edition) and it's worked great. Very easy and relatively intuitive.

Hi Rusty, Do you have a tutorial or something to start with?. I've seen that maybe, the best option is using something called hta.

August 31, 2016 at 1:57 am

Well I haven't personally used HTA (HTML Application), so cannot guide you on that.

I have however, written a GUI front-end to a multithreaded powershell back-end, and use this for my IT Admin tasks at work.

Here's a site that helped me early on,
Part I – Creating PowerShell GUIs in Minutes using Visual Studio – A New Hope

Let me know if you have any questions with anything.

  • This reply was modified 2 years ago by  84rusty ..

August 31, 2016 at 4:21 am

Here's a site that helped me early on,

Thanks, i will read on it.

So, the best option right now is Sapien´s....

August 31, 2016 at 7:34 am

You can make GUIs in Visual Studios.

As mentioned above, FoxDeploy have a great series on how to do it. The Sapien tools make it easy-er.

Here is my outline script – all you need to is create a WPF form in Visual Studios (which is free). Add name tags to your elements, copy and past the XAML in-between the @@ then run the script.

August 31, 2016 at 1:19 pm

Beware, most of the code on that fox deploy site is wrong. Looks like you have to hand code all the events.

$WPFbutton.Add_Click({$form.Close()}) is a no no!

August 31, 2016 at 2:15 pm

Excuse my ignorance, but why is $WPFbutton.Add_Click({$form.Close()}) a no no?

August 31, 2016 at 2:32 pm

First, we add all the events at form load; not after the button press.

Second, we use the buttons dialogresult property to close the form automatically.

  • This reply was modified 2 years ago by  Dan Potter.

August 31, 2016 at 5:05 pm

here's another interesting take on how to create GUIs with PowerShell

Micah has essentially set up an all-PowerShell replacement for HTAs that builds an ad-hoc web server that serves up custom HTML pages which can then run PowerShell code. It's an interesting idea in that most folks know or can easily learn some HTML to create simple forms.

September 1, 2016 at 8:38 pm

Thanks all for your kindly help !!

I will investigate about creating the gui in and export to the XAML...