Best Web or Desktop GUI for Powershell

This topic contains 19 replies, has 7 voices, and was last updated by Profile photo of Octavio Ricci Octavio Ricci 3 months, 1 week ago.

  • Author
    Posts
  • #52282
    Profile photo of Octavio Ricci
    Octavio Ricci
    Participant

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

  • #52289
    Profile photo of Arie H
    Arie H
    Participant

    Learn C#.

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

    • #52309
      Profile photo of Octavio Ricci
      Octavio Ricci
      Participant

      Thanks Arie, can it be vb.net too?

  • #52344
    Profile photo of Dan Potter
    Dan Potter
    Participant

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

    • #52376
      Profile photo of Octavio Ricci
      Octavio Ricci
      Participant

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

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

  • #52378
    Profile photo of Dan Potter
    Dan Potter
    Participant

    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
    
    
    • #52408
      Profile photo of Octavio Ricci
      Octavio Ricci
      Participant

      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.

    • #52417
      Profile photo of Dan Potter
      Dan Potter
      Participant

      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.

  • #52412
    Profile photo of Wilfredo Perez
    Wilfredo Perez
    Participant

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

  • #52624
    Profile photo of 84rusty .
    84rusty .
    Participant

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

    • #52635
      Profile photo of Octavio Ricci
      Octavio Ricci
      Participant

      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.

    • #52650
      Profile photo of 84rusty .
      84rusty .
      Participant

      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,

      Let me know if you have any questions with anything.

      • This reply was modified 3 months, 1 week ago by Profile photo of 84rusty . 84rusty ..
    • #52653
      Profile photo of Octavio Ricci
      Octavio Ricci
      Participant

      Here's a site that helped me early on,

      Thanks, i will read on it.

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

  • #52659
    Profile photo of Alex
    Alex
    Participant

    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.

  • #52682
    Profile photo of Dan Potter
    Dan Potter
    Participant

    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!

  • #52712
    Profile photo of Alex
    Alex
    Participant

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

  • #52722
    Profile photo of Dan Potter
    Dan Potter
    Participant

    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 3 months, 1 week ago by Profile photo of Dan Potter Dan Potter.
  • #52782
    Profile photo of Matt McNabb
    Matt McNabb
    Participant

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

    http://tiberriver256.github.io/powershell/gui/html/PowerShell-HTML-GUI-Pt1/

    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.

    • #53111
      Profile photo of Octavio Ricci
      Octavio Ricci
      Participant

      Thanks all for your kindly help !!

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

You must be logged in to reply to this topic.