Best Web or Desktop GUI for Powershell

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 !!!

Learn C#.

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

Thanks Arie, can it be vb.net too?

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

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

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

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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')
	
	[System.Windows.Forms.Application]::EnableVisualStyles()
	$form1 = New-Object 'System.Windows.Forms.Form'
	$button1 = New-Object 'System.Windows.Forms.Button'
	$InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState'
	
	
	$form1_Load={
		
	}
	
	
	
	$Form_StateCorrection_Load=
	{
		#Correct the initial state of the form to prevent the .Net maximized form issue
		$form1.WindowState = $InitialFormWindowState
	}
	
	$Form_Cleanup_FormClosed=
	{
		
		try
		{
			$form1.remove_Load($form1_Load)
			$form1.remove_Load($Form_StateCorrection_Load)
			$form1.remove_FormClosed($Form_Cleanup_FormClosed)
		}
		catch [Exception]
		{ }
	}
	
	$form1.Controls.Add($button1)
	$form1.AutoScaleDimensions = '6, 13'
	$form1.AutoScaleMode = 'Font'
	$form1.ClientSize = '284, 262'
	$form1.Name = 'form1'
	$form1.Text = 'Form'
	$form1.add_Load($form1_Load)
	
	$button1.Location = '61, 73'
	$button1.Name = 'button1'
	$button1.Size = '75, 23'
	$button1.TabIndex = 0
	$button1.Text = 'button1'
	$button1.UseVisualStyleBackColor = $True
	$form1.ResumeLayout()
	

	$InitialFormWindowState = $form1.WindowState
	
	$form1.add_Load($Form_StateCorrection_Load)
	
	$form1.add_FormClosed($Form_Cleanup_FormClosed)
	
	return $form1.ShowDialog()

} 

Call-blank_psf | Out-Null

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.

Try PowerShell Studio from Sapien

Try PowerShell Studio from Sapien https://www.sapien.com/software/powershell_studio

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.

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.

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

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.

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,
https://foxdeploy.com/2015/04/10/part-i-creating-powershell-guis-in-minutes-using-visual-studio-a-new-hope/

Let me know if you have any questions with anything.

Here's a site that helped me early on,

Thanks, i will read on it.

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

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.

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!

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

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.

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.

Thanks all for your kindly help !!

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