[PREVIEW] V1.2.4

This commit is contained in:
OlaYZen 2022-09-19 12:51:59 +02:00 committed by GitHub
parent 9feb57282f
commit 49ca19624a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,25 +39,47 @@ function CheckBoxFunc {
$button5.Visible = $true $button5.Visible = $true
$button6.Visible = $false $button6.Visible = $false
} }
$button5reboot }
function CheckBoxFunc2 {
if ($checkBox2.Checked)
{
$button8.Visible = $true
$button1.Visible = $false
}
else
{
$button8.Visible = $false
$button1.Visible = $true
}
} }
function GetWindowsUpdates { function GetWindowsUpdates {
( (
Get-WindowsUpdate -AcceptAll -Install Get-WindowsUpdate -AcceptAll -WindowsUpdate -ForceDownload
) )
$button1.Visible = $false $button1.Visible = $false
$button8.Visible = $false
} }
function GetWindowsUpdates2 {
(
Get-WindowsUpdate -AcceptAll -MicrosoftUpdate -ForceDownload
)
$button1.Visible = $false
$button8.Visible = $false
}
function UpdateWindowsUpdatesnoReboot { function UpdateWindowsUpdatesnoReboot {
( (
Install-WindowsUpdate -Confirm -AcceptAll Install-WindowsUpdate -Confirm -AcceptAll -ForceInstall
) )
} }
function UpdateWindowsUpdateswithReboot { function UpdateWindowsUpdateswithReboot {
( (
Install-WindowsUpdate -Confirm -AcceptAll -AutoReboot Install-WindowsUpdate -Confirm -AcceptAll -AutoReboot -ForceInstall
) )
} }
@ -92,6 +114,16 @@ $button1.TabIndex = 0
$button1.Text = "Get Windows Updates" $button1.Text = "Get Windows Updates"
$button1.Add_Click({GetWindowsUpdates}) $button1.Add_Click({GetWindowsUpdates})
[System.Windows.Forms.Application]::EnableVisualStyles()
$button8 = New-Object System.Windows.Forms.Button
$button8.Location = '12, 5'
$button8.Name = "Get Windows Updates"
$button8.Size = '95, 55'
$button8.Visible = $false
$button8.TabIndex = 0
$button8.Text = "Get Windows Updates"
$button8.Add_Click({GetWindowsUpdates2})
[System.Windows.Forms.Application]::EnableVisualStyles() [System.Windows.Forms.Application]::EnableVisualStyles()
$button5 = New-Object System.Windows.Forms.Button $button5 = New-Object System.Windows.Forms.Button
$button5.Location = '12, 5' $button5.Location = '12, 5'
@ -148,11 +180,17 @@ $button4.Text = "Edit Winget Software"
$button4.Add_Click({EditWinget}) $button4.Add_Click({EditWinget})
$checkBox = new-object System.Windows.Forms.checkbox $checkBox = new-object System.Windows.Forms.checkbox
$checkBox.Location = '12, 55' $checkBox.Location = '12, 65'
$checkBox.Size = '95, 55' $checkBox.Size = '85, 15'
$checkBox.Text = "AutoReboot" $checkBox.Text = "AutoReboot"
$checkBox.Add_Click({CheckBoxFunc}) $checkBox.Add_Click({CheckBoxFunc})
$checkBox2 = new-object System.Windows.Forms.checkbox
$checkBox2.Location = '12, 65'
$checkBox2.Size = '95, 55'
$checkBox2.Text = "Microsoft Update"
$checkBox2.Add_Click({CheckBoxFunc2})
$AutoReboot = New-Object System.Windows.Forms.TextBox $AutoReboot = New-Object System.Windows.Forms.TextBox
$AutoReboot.Location = '12, 175' $AutoReboot.Location = '12, 175'
$AutoReboot.Multiline = $true $AutoReboot.Multiline = $true
@ -173,17 +211,18 @@ $VersionLabel.Location = '216, 90'
#Preview Label #Preview Label
$VersionLabel.Name = 'Versionlabel' $VersionLabel.Name = 'Versionlabel'
$VersionLabel.Text = "Version 1.2.3 PREVIEW" $VersionLabel.Text = "Version 1.2.4 PREVIEW"
$VersionLabel.Size = '490, 500' $VersionLabel.Size = '490, 500'
$Form = New-Object System.Windows.Forms.Form $Form = New-Object System.Windows.Forms.Form
$Form.StartPosition = "CenterScreen" $Form.StartPosition = "CenterScreen"
$Form.FormBorderStyle = [System.Windows.Forms.FormBorderStyle]::FixedDialog $Form.FormBorderStyle = [System.Windows.Forms.FormBorderStyle]::FixedDialog
$Form.Name = "Form" $Form.Name = "mainForm"
$Form.Text = "Windows and Winget Updates" $Form.Text = "Windows and Winget Updates"
$Form.MaximizeBox = $False $Form.MaximizeBox = $False
$Form.ShowInTaskbar = $true $Form.ShowInTaskbar = $true
$Form.Controls.Add($button1) $Form.Controls.Add($button1)
$Form.Controls.Add($button8)
$Form.Controls.Add($button2) $Form.Controls.Add($button2)
$Form.Controls.Add($button3) $Form.Controls.Add($button3)
$Form.Controls.Add($button7) $Form.Controls.Add($button7)
@ -191,6 +230,7 @@ $Form.Controls.Add($button4)
$Form.Controls.Add($button5) $Form.Controls.Add($button5)
$Form.Controls.Add($button6) $Form.Controls.Add($button6)
$Form.Controls.Add($checkBox) $Form.Controls.Add($checkBox)
$Form.Controls.Add($checkBox2)
$Form.Controls.Add($AutoReboot) $Form.Controls.Add($AutoReboot)
$Form.Controls.Add($VersionLabel) $Form.Controls.Add($VersionLabel)
$Form.Controls.Add($RichTextBoxDisplay) $Form.Controls.Add($RichTextBoxDisplay)
@ -219,4 +259,4 @@ else
[void]$Form.ShowDialog() [void]$Form.ShowDialog()
[void]$stream.Dispose() [void]$stream.Dispose()
[void]$Form.Dispose() [void]$Form.Dispose()