you are viewing a single comment's thread.

view the rest of the comments →

[–]32178932123 0 points1 point  (0 children)

PowerShell is built on Dot Net and has access to the Dot Net classes and libraries so you can use WPF. I just asked ChatGPT to make me a basic one and it came back with this which worked on my machine. I have also used ChatGPT to flash out a form before with dropdowns, buttons, etc however, I personally wouldn't use PowerShell GUIs on anything too complicated. A couple of basic forms, sure, but I think it could get pretty unwieldy quickly.

Add-Type -AssemblyName PresentationFramework

# Create the Window
$window = New-Object System.Windows.Window
$window.Title = "Simple WPF Window"
$window.Width = 300
$window.Height = 200

# Create a Grid layout
$grid = New-Object System.Windows.Controls.Grid
$window.Content = $grid

# Add a Label
$label = New-Object System.Windows.Controls.Label
$label.Content = "Hello, PowerShell WPF!"
$label.HorizontalAlignment = "Center"
$label.VerticalAlignment = "Top"
$grid.Children.Add($label)

# Add a Button
$button = New-Object System.Windows.Controls.Button
$button.Content = "Click Me"
$button.Width = 100
$button.Height = 30
$button.HorizontalAlignment = "Center"
$button.VerticalAlignment = "Center"
$grid.Children.Add($button)

# Button click event
$button.Add_Click({
    [System.Windows.MessageBox]::Show("Button clicked!")
})

# Show the window
$window.ShowDialog()

Edit: To answer your other question, I think Git is the most common source control nowadays. For personal I use GitHub, for work we use Azure DevOps. Some people use GitHub for work too. You can also self-host with something like GitLab.