mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-07-01 02:22:34 -05:00
Extend Functionality
This commit is contained in:
@ -15,8 +15,8 @@ function Install-WinUtilChoco {
|
||||
}
|
||||
|
||||
Write-Host "Seems Chocolatey is not installed, installing now."
|
||||
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) -ErrorAction Stop
|
||||
powershell choco feature enable -n allowGlobalConfirmation
|
||||
Start-Process -FilePath "powershell" -ArgumentList "Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) -ErrorAction Stop" -Wait -NoNewWindow
|
||||
Start-Process -FilePath "powershell" -ArgumentList "choco feature enable -n allowGlobalConfirmation" -Wait -NoNewWindow
|
||||
|
||||
} catch {
|
||||
Write-Host "===========================================" -Foregroundcolor Red
|
||||
|
@ -1,26 +1,33 @@
|
||||
function Set-DownloadEngine {
|
||||
$CheckBoxes = $sync.GetEnumerator() | Where-Object { $_.Value -is [System.Windows.Controls.CheckBox] }
|
||||
|
||||
foreach ($CheckBox in $CheckBoxes) {
|
||||
if ($CheckBox.Key.StartsWith("WPFInstall")) {
|
||||
Switch ($sync.DownloadEngine) {
|
||||
"Winget" {
|
||||
if ($($sync.configs.applications.$($CheckBox.Name).winget) -eq "na"){
|
||||
$CheckBox.Value.Visibility = "Collapsed"
|
||||
$sync."$($CheckBox.Key)Link".Visibility = "Collapsed"
|
||||
|
||||
}
|
||||
else{
|
||||
$CheckBox.Value.Visibility = "Visible"
|
||||
$sync."$($CheckBox.Key)Link".Visibility = "Visible"
|
||||
}
|
||||
}
|
||||
"Chocolatey"{
|
||||
if ($($sync.configs.applications.$($CheckBox.Name).chocolatey) -eq "na"){
|
||||
$CheckBox.Value.Visibility = "Collapsed"
|
||||
$sync."$($CheckBox.Key)Link".Visibility = "Collapsed"
|
||||
}
|
||||
else {
|
||||
$CheckBox.Value.Visibility = "Visible"
|
||||
$sync."$($CheckBox.Key)Link".Visibility = "Visible"
|
||||
}
|
||||
}
|
||||
default{
|
||||
$CheckBox.Value.Visibility = "Visible"
|
||||
$sync."$($CheckBox.Key)Link".Visibility = "Visible"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user