#
.NOTES
Author : Chris Titus @christitustech
GitHub : https://github.com/ChrisTitusTech
Version 0.0.1
#>
$inputXML = @"
"@
$inputXML = $inputXML -replace 'mc:Ignorable="d"','' -replace "x:N",'N' -replace '^
Write-Host "Unable to load Windows.Markup.XamlReader. Double-check syntax and ensure .net is installed."
}
#===========================================================================
# Store Form Objects In PowerShell
#===========================================================================
$xaml.SelectNodes("//*[@Name]") | %{Set-Variable -Name "WPF$($_.Name)" -Value $Form.FindName($_.Name)}
Function Get-FormVariables{
if ($global:ReadmeDisplay -ne $true){Write-host "If you need to reference this display again, run Get-FormVariables" -ForegroundColor Yellow;$global:ReadmeDisplay=$true}
write-host "Found the following interactable elements from our form" -ForegroundColor Cyan
get-variable WPF*
}
Get-FormVariables
#===========================================================================
# Navigation Controls
#===========================================================================
$WPFTab1BT.Add_Click({
$WPFTabNav.Items[0].IsSelected = $true
$WPFTabNav.Items[1].IsSelected = $false
$WPFTabNav.Items[2].IsSelected = $false
$WPFTabNav.Items[3].IsSelected = $false
})
$WPFTab2BT.Add_Click({
$WPFTabNav.Items[0].IsSelected = $false
$WPFTabNav.Items[1].IsSelected = $true
$WPFTabNav.Items[2].IsSelected = $false
$WPFTabNav.Items[3].IsSelected = $false
})
$WPFTab3BT.Add_Click({
$WPFTabNav.Items[0].IsSelected = $false
$WPFTabNav.Items[1].IsSelected = $false
$WPFTabNav.Items[2].IsSelected = $true
$WPFTabNav.Items[3].IsSelected = $false
})
$WPFTab4BT.Add_Click({
$WPFTabNav.Items[0].IsSelected = $false
$WPFTabNav.Items[1].IsSelected = $false
$WPFTabNav.Items[2].IsSelected = $false
$WPFTabNav.Items[3].IsSelected = $true
})
#===========================================================================
# Install Tab1
#===========================================================================
$WPFinstall.Add_Click({
If ( $WPFadobe.IsChecked -eq $true ) {
winget install -e --id Adobe.Acrobat.Reader.64-bit | Out-Host
$WPFadobe.IsChecked = $false
}
If ( $WPFadvancedip.IsChecked -eq $true ) {
winget install -e Famatech.AdvancedIPScanner | Out-Host
$WPFadvancedip.IsChecked = $false
}
If ( $WPFautohotkey.IsChecked -eq $true ) {
winget install -e Lexikos.AutoHotkey | Out-Host
$WPFautohotkey.IsChecked = $false
}
If ( $WPFbrave.IsChecked -eq $true ) {
winget install -e BraveSoftware.BraveBrowser | Out-Host
$WPFbrave.IsChecked = $false
}
If ( $WPFchrome.IsChecked -eq $true ) {
winget install -e Google.Chrome | Out-Host
$WPFchrome.IsChecked = $false
}
If ( $WPFdiscord.IsChecked -eq $true ) {
winget install -e Discord.Discord | Out-Host
$WPFdiscord.IsChecked = $false
}
If ( $WPFesearch.IsChecked -eq $true ) {
winget install -e voidtools.Everything --source winget | Out-Host
$WPFesearch.IsChecked = $false
}
If ( $WPFetcher.IsChecked -eq $true ) {
winget install -e Balena.Etcher | Out-Host
$WPFetcher.IsChecked = $false
}
If ( $WPFfirefox.IsChecked -eq $true ) {
winget install -e Mozilla.Firefox | Out-Host
$WPFfirefox.IsChecked = $false
}
If ( $WPFgimp.IsChecked -eq $true ) {
winget install -e GIMP.GIMP | Out-Host
$WPFgimp.IsChecked = $false
}
If ( $WPFgithubdesktop.IsChecked -eq $true ) {
winget install -e Git.Git | Out-Host
winget install -e GitHub.GitHubDesktop | Out-Host
$WPFgithubdesktop.IsChecked = $false
}
If ( $WPFimageglass.IsChecked -eq $true ) {
winget install -e DuongDieuPhap.ImageGlass | Out-Host
$WPFimageglass.IsChecked = $false
}
If ( $WPFmpc.IsChecked -eq $true ) {
winget install -e clsid2.mpc-hc | Out-Host
$WPFmpc.IsChecked = $false
}
If ( $WPFnotepadplus.IsChecked -eq $true ) {
winget install -e Notepad++.Notepad++ | Out-Host
$WPFnotepadplus.IsChecked = $false
}
If ( $WPFpowertoys.IsChecked -eq $true ) {
winget install -e Microsoft.PowerToys | Out-Host
$WPFpowertoys.IsChecked = $false
}
If ( $WPFputty.IsChecked -eq $true ) {
winget install -e PuTTY.PuTTY | Out-Host
winget install -e WinSCP.WinSCP | Out-Host
$WPFputty.IsChecked = $false
}
If ( $WPFsevenzip.IsChecked -eq $true ) {
winget install -e 7zip.7zip | Out-Host
$WPFsevenzip.IsChecked = $false
}
If ( $WPFsharex.IsChecked -eq $true ) {
winget install -e ShareX.ShareX | Out-Host
$WPFsharex.IsChecked = $false
}
If ( $WPFsumatra.IsChecked -eq $true ) {
winget install -e SumatraPDF.SumatraPDF | Out-Host
$WPFsumatra.IsChecked = $false
}
If ( $WPFterminal.IsChecked -eq $true ) {
winget install -e Microsoft.WindowsTerminal | Out-Host
$WPFterminal.IsChecked = $false
}
If ( $WPFttaskbar.IsChecked -eq $true ) {
winget install -e TranslucentTB.TranslucentTB | Out-Host
$WPFttaskbar.IsChecked = $false
}
If ( $WPFvlc.IsChecked -eq $true ) {
winget install -e VideoLAN.VLC | Out-Host
$WPFvlc.IsChecked = $false
}
If ( $WPFvscode.IsChecked -eq $true ) {
winget install -e Git.Git | Out-Host
winget install -e Microsoft.VisualStudioCode --source winget | Out-Host
$WPFvscode.IsChecked = $false
}
If ( $WPFvscodium.IsChecked -eq $true ) {
winget install -e Git.Git | Out-Host
winget install -e VSCodium.VSCodium | Out-Host
$WPFvscodium.IsChecked = $false
}
})
#===========================================================================
# Shows the form
#===========================================================================
$Form.ShowDialog() | out-null