2023 09 23 test (#1117)

* move restore point to runspace (#1056)

* Add Guilded into Communication Tab (#1059)

* Add Guilded into Communication Tab

* Remove Choco Package due to there is no Chocolatey packages

* : Add ZeroTier One to utilities menu (#1061)

* Update applications.json (#1063)

Update to add [SuperF4 - Stefan Sundin](https://stefansundin.github.io/superf4/), as mentioned in #374 [Choco - SuperF4](https://community.chocolatey.org/packages/superf4) maintained by Xav83. [WinGet - SuperF4](https://winstall.app/apps/StefanSundin.Superf4) SuperF4 and Winget package published by Stefan Sundin.

* Update inputXML.xaml (#1062)

Updated inputXML.xaml to account for addition of the SuperF4 software.

* Added AIMP music player (#1064)

* Add Ventoy (Chocolatey Only Package) & .NET Core Runtime (Winget & Chocolatey)  (#1066)

* Tidy up SuperF4 line.

* Tidy up SuperF4 line.

Used spaces instead of tabs.

* Add dotnet 7.0.11 Desktop Runtime

* Undone changes to SuperF4 line

* Addition of Ventoy (chocolatey only) package

* Comment Spacing, Indentation, and Capitalization (#1084)

* Comment Spacing, Indentation, and Capitalization

* Comment Grammar and Spacing

Makes grammar in comments better and more consistent
Adds space before comment and centers word in `Write-Host` commands

* More Grammar and Formatting

* Add some comments

* Populate PlaceHolder comments in functions

Files I found that has issues:
Get-WinUtilRegistry.ps1
Install-WinUtilWinget.ps1
Invoke-WinUtilDarkMode.ps1
Remove-WinUtilAPPX.ps1
Test-WinUtilPackageManager.ps1
Update-WinUtilProgramWinget.ps1

Invoke-WPFUpdatessecurity.ps1

* Tweak a few more comments

* Tweak another write-host statement

* Undo Catch statement adjustment

It's outside of the scope of this pull request

* Trim Trailing Whitespace (#1085)

* Trim Trailing Whitespace

* Revert "Trim Trailing Whitespace"

This reverts commit 0ce32aa2c2.

* Trim Trailing Whitespace, take 2

* Bug Fixes

- Edge Removal pullback to local
- Formatting fixes

* testing refactor to ps1

* Update winget-install to 3.0.1 (#1086)

* Update tweaks.json (#1087)

Capitalized first letter of "path" --> "Path" keys

* Update edgeremoval.ps1

* Update edgeremoval.ps1

* Update edgeremoval.ps1

add error handling

* Update functions.Tests.ps1

* fix catch error

* add MSI Afterburner (#1097)

* Add GitHub stats

* Remove Application Experience

* Thorium addition

* remove sample submission

* testing

* Ultimate Performance

* Home GPEDIT

* Fix Winget Install on New System

---------

Co-authored-by: DeveloperDurp <developerdurp@durp.info>
Co-authored-by: Justawildwolf <62820836+blusewill@users.noreply.github.com>
Co-authored-by: Tim Stone <github@tsdev.au>
Co-authored-by: Will Barnard <5012445+mrwillbarnz@users.noreply.github.com>
Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
Co-authored-by: Carter <60557606+Carterpersall@users.noreply.github.com>
Co-authored-by: Yorai Levi <yorai.email@gmail.com>
Co-authored-by: Saikrishnan K <53394202+K-Saikrishnan@users.noreply.github.com>
This commit is contained in:
Chris Titus
2023-10-19 17:12:55 -05:00
committed by GitHub
parent 051b770661
commit d0bde83333
66 changed files with 2041 additions and 921 deletions

View File

@ -2,13 +2,19 @@ Function Get-WinUtilCheckBoxes {
<#
.DESCRIPTION
Function is meant to find all checkboxes that are checked on the specific tab and input them into a script.
.SYNOPSIS
Finds all checkboxes that are checked on the specific tab and inputs them into a script.
Outputed data will be the names of the checkboxes that were checked
.PARAMETER Group
The group of checkboxes to check
.EXAMPLE
.PARAMETER unCheck
Whether to uncheck the checkboxes that are checked. Defaults to true
.OUTPUTS
A List containing the name of each checked checkbox
.EXAMPLE
Get-WinUtilCheckBoxes "WPFInstall"
#>
@ -32,18 +38,18 @@ Function Get-WinUtilCheckBoxes {
if ($uncheck -eq $true){
$CheckBox.value.ischecked = $false
}
}
}
}
if($Group -eq "WPFTweaks"){
$filter = Get-WinUtilVariables -Type Checkbox | Where-Object {$psitem -like "WPF*Tweaks*"}
$CheckBoxes = $sync.GetEnumerator() | Where-Object {$psitem.Key -in $filter}
Foreach ($CheckBox in $CheckBoxes){
if($CheckBox.value.ischecked -eq $true){
$Output.Add($Checkbox.Name)
if ($uncheck -eq $true){
$CheckBox.value.ischecked = $false
}
@ -57,7 +63,7 @@ Function Get-WinUtilCheckBoxes {
Foreach ($CheckBox in $CheckBoxes){
if($CheckBox.value.ischecked -eq $true){
$Output.Add($Checkbox.Name)
if ($uncheck -eq $true){
$CheckBox.value.ischecked = $false
}

View File

@ -1,9 +1,15 @@
function Get-WinUtilInstallerProcess {
<#
.DESCRIPTION
Meant to check for running processes and will return a boolean response
.SYNOPSIS
Checks if the given process is running
.PARAMETER Process
The process to check
.OUTPUTS
Boolean - True if the process is running
#>
param($Process)

View File

@ -1,14 +1,13 @@
function Get-WinUtilRegistry {
<#
.DESCRIPTION
This function will make all modifications to the registry
.EXAMPLE
.SYNOPSIS
Gets the value of a registry key
Set-WinUtilRegistry -Name "PublishUserActivities" -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Type "DWord" -Value "0"
#>
.EXAMPLE
Get-WinUtilRegistry -Name "PublishUserActivities" -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Type "DWord" -Value "0"
#>
param (
$Name,
$Path,
@ -16,7 +15,7 @@ function Get-WinUtilRegistry {
$Value
)
Try{
Try{
$syscheckvalue = Get-ItemPropertyValue -Path $Path -Value $Value # Return Value
}

View File

@ -1,12 +1,15 @@
Function Get-WinUtilToggleStatus {
<#
.DESCRIPTION
Meant to pull the registry keys for a toggle switch and returns true or false
True should mean status is enabled
False should mean status is disabled
.SYNOPSIS
Pulls the registry keys for the given toggle switch and checks whether the toggle should be checked or unchecked
.PARAMETER ToggleSwitch
The name of the toggle to check
.OUTPUTS
Boolean to set the toggle's status to
#>
Param($ToggleSwitch)
@ -15,7 +18,7 @@ Function Get-WinUtilToggleStatus {
$system = (Get-ItemProperty -path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize').SystemUsesLightTheme
if($app -eq 0 -and $system -eq 0){
return $true
}
}
else{
return $false
}
@ -24,7 +27,7 @@ Function Get-WinUtilToggleStatus {
$bingsearch = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Search').BingSearchEnabled
if($bingsearch -eq 0){
return $false
}
}
else{
return $true
}

View File

@ -1,10 +1,13 @@
function Get-WinUtilVariables {
<#
.DESCRIPTION
placeholder
.SYNOPSIS
Gets every form object of the provided type
.OUTPUTS
List containing every object that matches the provided type
#>
param (
[Parameter()]
@ -12,7 +15,7 @@ function Get-WinUtilVariables {
[string]$Type
)
$keys = $sync.keys | Where-Object {$psitem -like "WPF*"}
$keys = $sync.keys | Where-Object {$psitem -like "WPF*"}
if($type){
$output = $keys | ForEach-Object {
@ -23,7 +26,7 @@ function Get-WinUtilVariables {
}
Catch{<#I am here so errors don't get outputted for a couple variables that don't have the .GetType() attribute#>}
}
return $output
return $output
}
return $keys
}

View File

@ -1,30 +1,29 @@
function Install-WinUtilChoco {
<#
.DESCRIPTION
Function is meant to ensure Choco is installed
.SYNOPSIS
Installs Chocolatey if it is not already installed
#>
try{
try {
Write-Host "Checking if Chocolatey is Installed..."
if((Test-WinUtilPackageManager -choco)){
Write-Host "Chocolatey Already Installed"
return
}
Write-Host "Seems Chocolatey is not installed, installing now?"
#Let user decide if he wants to install Chocolatey
$confirmation = Read-Host "Are you Sure You Want To Proceed:(y/n)"
if ($confirmation -eq 'y') {
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
}
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
}
Catch{
throw [ChocoFailedInstall]::new('Failed to install')
Catch {
Write-Host "==========================================="
Write-Host "-- Chocolatey failed to install ---"
Write-Host "==========================================="
}
}

View File

@ -1,12 +1,19 @@
Function Install-WinUtilProgramWinget {
<#
.DESCRIPTION
This will install programs via Winget using a new powershell.exe instance to prevent the GUI from locking up.
Note the triple quotes are required any time you need a " in a normal script block.
.SYNOPSIS
Manages the provided programs using Winget
.PARAMETER ProgramsToInstall
A list of programs to manage
.PARAMETER manage
The action to perform on the programs, can be either 'Installing' or 'Uninstalling'
.NOTES
The triple quotes are required any time you need a " in a normal script block.
#>
param(
@ -20,7 +27,7 @@ Function Install-WinUtilProgramWinget {
Write-Progress -Activity "$manage Applications" -Status "Starting" -PercentComplete 0
Foreach ($Program in $($ProgramsToInstall -split ",")){
Write-Progress -Activity "$manage Applications" -Status "$manage $Program $($x + 1) of $count" -PercentComplete $($x/$count*100)
if($manage -eq "Installing"){
Start-Process -FilePath winget -ArgumentList "install -e --accept-source-agreements --accept-package-agreements --silent $Program" -NoNewWindow -Wait
@ -28,7 +35,7 @@ Function Install-WinUtilProgramWinget {
if($manage -eq "Uninstalling"){
Start-Process -FilePath winget -ArgumentList "uninstall -e --purge --force --silent $Program" -NoNewWindow -Wait
}
$X++
}

View File

@ -1,29 +1,29 @@
function Get-LatestHash {
$shaUrl = ((Invoke-WebRequest $apiLatestUrl -UseBasicParsing | ConvertFrom-Json).assets | Where-Object { $_.name -match '^Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.txt$' }).browser_download_url
$shaFile = Join-Path -Path $tempFolder -ChildPath 'Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.txt'
$WebClient.DownloadFile($shaUrl, $shaFile)
Get-Content $shaFile
}
}
function Install-WinUtilWinget {
<#
.DESCRIPTION
Function is meant to ensure winget is installed
.SYNOPSIS
Installs Winget if it is not already installed
#>
Try{
Write-Host "Checking if Winget is Installed..."
if (Test-WinUtilPackageManager -winget) {
#Checks if winget executable exists and if the Windows Version is 1809 or higher
# Checks if winget executable exists and if the Windows Version is 1809 or higher
Write-Host "Winget Already Installed"
return
}
#Gets the computer's information
# Gets the computer's information
if ($null -eq $sync.ComputerInfo){
$ComputerInfo = Get-ComputerInfo -ErrorAction Stop
}
@ -32,14 +32,14 @@ function Install-WinUtilWinget {
}
if (($ComputerInfo.WindowsVersion) -lt "1809") {
#Checks if Windows Version is too old for winget
# Checks if Windows Version is too old for winget
Write-Host "Winget is not supported on this version of Windows (Pre-1809)"
return
}
Write-Host "Running Alternative Installer and Direct Installing"
Start-Process -Verb runas -FilePath powershell.exe -ArgumentList "irm https://raw.githubusercontent.com/ChrisTitusTech/winutil/main/winget.ps1 | iex"
Start-Process -Verb runas -FilePath powershell.exe -ArgumentList "choco install winget"
Write-Host "Winget Installed"
}
Catch{

View File

@ -1,9 +1,12 @@
function Invoke-WinUtilBingSearch {
<#
.DESCRIPTION
Sets Bing Search on or off
<#
.SYNOPSIS
Disables/Enables Bing Search
.PARAMETER Enabled
Indicates whether to enable or disable Bing Search
#>
Param($Enabled)
Try{

View File

@ -2,13 +2,10 @@ Function Invoke-WinUtilCurrentSystem {
<#
.DESCRIPTION
Function is meant to read existing system registry and check according configuration.
Example: Is telemetry enabled? check the box.
.EXAMPLE
.SYNOPSIS
Checks to see what tweaks have already been applied and what programs are installed, and checks the according boxes
.EXAMPLE
Get-WinUtilCheckBoxes "WPFInstall"
#>
@ -46,19 +43,19 @@ Function Invoke-WinUtilCurrentSystem {
$registryKeys = $sync.configs.tweaks.$Config.registry
$scheduledtaskKeys = $sync.configs.tweaks.$Config.scheduledtask
$serviceKeys = $sync.configs.tweaks.$Config.service
if($registryKeys -or $scheduledtaskKeys -or $serviceKeys){
$Values = @()
Foreach ($tweaks in $registryKeys){
Foreach($tweak in $tweaks){
if(test-path $tweak.Path){
$actualValue = Get-ItemProperty -Name $tweak.Name -Path $tweak.Path -ErrorAction SilentlyContinue | Select-Object -ExpandProperty $($tweak.Name)
$expectedValue = $tweak.Value
if ($expectedValue -notlike $actualValue){
$values += $False
$values += $False
}
}
}
@ -67,7 +64,7 @@ Function Invoke-WinUtilCurrentSystem {
Foreach ($tweaks in $scheduledtaskKeys){
Foreach($tweak in $tweaks){
$task = $ScheduledTasks | Where-Object {$($psitem.TaskPath + $psitem.TaskName) -like "\$($tweak.name)"}
if($task){
$actualValue = $task.State
$expectedValue = $tweak.State
@ -81,7 +78,7 @@ Function Invoke-WinUtilCurrentSystem {
Foreach ($tweaks in $serviceKeys){
Foreach($tweak in $tweaks){
$Service = Get-Service -Name $tweak.Name
if($Service){
$actualValue = $Service.StartType
$expectedValue = $tweak.StartupType

View File

@ -1,9 +1,12 @@
Function Invoke-WinUtilDarkMode {
<#
.DESCRIPTION
Sets Dark Mode on or off
<#
.SYNOPSIS
Enables/Disables Dark Mode
.PARAMETER DarkMoveEnabled
Indicates the current dark mode state
#>
Param($DarkMoveEnabled)
Try{
@ -15,7 +18,7 @@ Function Invoke-WinUtilDarkMode {
Write-Host "Disabling Dark Mode"
$DarkMoveValue = 1
}
$Theme = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"
Set-ItemProperty -Path $Theme -Name AppsUseLightTheme -Value $DarkMoveValue
Set-ItemProperty -Path $Theme -Name SystemUsesLightTheme -Value $DarkMoveValue

View File

@ -1,9 +1,9 @@
function Invoke-WinUtilFeatureInstall {
<#
.DESCRIPTION
This function converts all the values from the tweaks.json and routes them to the appropriate function
.SYNOPSIS
Converts all the values from the tweaks.json and routes them to the appropriate function
#>
param(
@ -13,7 +13,7 @@ function Invoke-WinUtilFeatureInstall {
$CheckBox | ForEach-Object {
if($sync.configs.feature.$psitem.feature){
Foreach( $feature in $sync.configs.feature.$psitem.feature ){
Try{
Try{
Write-Host "Installing $feature"
Enable-WindowsOptionalFeature -Online -FeatureName $feature -All -NoRestart
}
@ -24,10 +24,10 @@ function Invoke-WinUtilFeatureInstall {
else{
Write-Warning "Unable to Install $feature due to unhandled exception"
Write-Warning $psitem.Exception.StackTrace
Write-Warning $psitem.Exception.StackTrace
}
}
}
}
}
if($sync.configs.feature.$psitem.InvokeScript){
Foreach( $script in $sync.configs.feature.$psitem.InvokeScript ){
@ -44,10 +44,10 @@ function Invoke-WinUtilFeatureInstall {
else{
Write-Warning "Unable to Install $feature due to unhandled exception"
Write-Warning $psitem.Exception.StackTrace
Write-Warning $psitem.Exception.StackTrace
}
}
}
}
}
}
}

View File

@ -1,14 +1,19 @@
function Invoke-WinUtilScript {
<#
.DESCRIPTION
This function will run a separate powershell script. Meant for things that can't be handled with the other functions
.EXAMPLE
.SYNOPSIS
Invokes the provided scriptblock. Intended for things that can't be handled with the other functions.
.PARAMETER Name
The name of the scriptblock being invoked
.PARAMETER scriptblock
The scriptblock to be invoked
.EXAMPLE
$Scriptblock = [scriptblock]::Create({"Write-output 'Hello World'"})
Invoke-WinUtilScript -ScriptBlock $scriptblock -Name "Hello World"
#>
param (
$Name,
@ -38,7 +43,7 @@ function Invoke-WinUtilScript {
Catch {
# Generic catch block to handle any other type of exception
Write-Warning "Unable to run script for $name due to unhandled exception"
Write-Warning $psitem.Exception.StackTrace
Write-Warning $psitem.Exception.StackTrace
}
}

View File

@ -1,9 +1,15 @@
function Invoke-WinUtilTweaks {
<#
.DESCRIPTION
This function converts all the values from the tweaks.json and routes them to the appropriate function
.SYNOPSIS
Invokes the function associated with each provided checkbox
.PARAMETER CheckBox
The checkbox to invoke
.PARAMETER undo
Indicates whether to undo the operation contained in the checkbox
#>
param(
@ -18,7 +24,7 @@ function Invoke-WinUtilTweaks {
ScriptType = "UndoScript"
}
}
}
Else{
$Values = @{
Registry = "Value"

View File

@ -1,13 +1,15 @@
function Remove-WinUtilAPPX {
<#
.DESCRIPTION
This function will remove any of the provided APPX names
.EXAMPLE
.SYNOPSIS
Removes all APPX packages that match the given name
.PARAMETER Name
The name of the APPX package to remove
.EXAMPLE
Remove-WinUtilAPPX -Name "Microsoft.Microsoft3DViewer"
#>
param (
$Name
@ -24,11 +26,11 @@ function Remove-WinUtilAPPX {
}
Else{
Write-Warning "Unable to uninstall $name due to unhandled exception"
Write-Warning $psitem.Exception.StackTrace
Write-Warning $psitem.Exception.StackTrace
}
}
Catch{
Write-Warning "Unable to uninstall $name due to unhandled exception"
Write-Warning $psitem.Exception.StackTrace
Write-Warning $psitem.Exception.StackTrace
}
}

View File

@ -1,13 +1,15 @@
function Set-WinUtilDNS {
<#
.DESCRIPTION
This function will set the DNS of all interfaces that are in the "Up" state. It will lookup the values from the DNS.Json file
.EXAMPLE
.SYNOPSIS
Sets the DNS of all interfaces that are in the "Up" state. It will lookup the values from the DNS.Json file
.PARAMETER DNSProvider
The DNS provider to set the DNS server to
.EXAMPLE
Set-WinUtilDNS -DNSProvider "google"
#>
param($DNSProvider)
if($DNSProvider -eq "Default"){return}
@ -27,6 +29,6 @@ function Set-WinUtilDNS {
}
Catch{
Write-Warning "Unable to set DNS Provider due to an unhandled exception"
Write-Warning $psitem.Exception.StackTrace
Write-Warning $psitem.Exception.StackTrace
}
}

View File

@ -1,14 +1,25 @@
function Set-WinUtilRegistry {
<#
.DESCRIPTION
This function will make all modifications to the registry
.EXAMPLE
.SYNOPSIS
Modifies the registry based on the given inputs
.PARAMETER Name
The name of the key to modify
.PARAMETER Path
The path to the key
.PARAMETER Type
The type of value to set the key to
.PARAMETER Value
The value to set the key to
.EXAMPLE
Set-WinUtilRegistry -Name "PublishUserActivities" -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Type "DWord" -Value "0"
#>
#>
param (
$Name,
$Path,
@ -16,7 +27,7 @@ function Set-WinUtilRegistry {
$Value
)
Try{
Try{
if(!(Test-Path 'HKU:\')){New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS}
If (!(Test-Path $Path)) {

View File

@ -1,10 +1,10 @@
function Set-WinUtilRestorePoint {
<#
.DESCRIPTION
This function will make a Restore Point
#>
.SYNOPSIS
Creates a Restore Point
#>
# Check if the user has administrative privileges
if (-Not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
@ -24,7 +24,7 @@ function Set-WinUtilRestorePoint {
$exists = Get-ItemProperty -path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore" -name "SystemRestorePointCreationFrequency" -ErrorAction SilentlyContinue
if($null -eq $exists){
write-host 'Changing system to allow multiple restore points per day'
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore" -Name "SystemRestorePointCreationFrequency" -Value "0" -Type DWord -Force -ErrorAction Stop | Out-Null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore" -Name "SystemRestorePointCreationFrequency" -Value "0" -Type DWord -Force -ErrorAction Stop | Out-Null
}
# Get all the restore points for the current day
@ -33,7 +33,7 @@ function Set-WinUtilRestorePoint {
# Check if there is already a restore point created today
if ($existingRestorePoints.Count -eq 0) {
$description = "System Restore Point created by WinUtil"
Checkpoint-Computer -Description $description -RestorePointType "MODIFY_SETTINGS"
Write-Host -ForegroundColor Green "System Restore Point Created Successfully"
}

View File

@ -1,13 +1,18 @@
function Set-WinUtilScheduledTask {
<#
.DESCRIPTION
This function will enable/disable the provided Scheduled Task
.EXAMPLE
.SYNOPSIS
Enables/Disables the provided Scheduled Task
.PARAMETER Name
The path to the Scheduled Task
.PARAMETER State
The State to set the Task to
.EXAMPLE
Set-WinUtilScheduledTask -Name "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" -State "Disabled"
#>
param (
$Name,
@ -35,6 +40,6 @@ function Set-WinUtilScheduledTask {
}
Catch{
Write-Warning "Unable to run script for $name due to unhandled exception"
Write-Warning $psitem.Exception.StackTrace
Write-Warning $psitem.Exception.StackTrace
}
}

View File

@ -1,24 +1,29 @@
Function Set-WinUtilService {
<#
.DESCRIPTION
This function will change the startup type of services and start/stop them as needed
.EXAMPLE
.SYNOPSIS
Changes the startup type of the given service
.PARAMETER Name
The name of the service to modify
.PARAMETER StartupType
The startup type to set the service to
.EXAMPLE
Set-WinUtilService -Name "HomeGroupListener" -StartupType "Manual"
#>
#>
param (
$Name,
$StartupType
)
try {
Write-Host "Setting Service $Name to $StartupType"
# Check if the service exists
$service = Get-Service -Name $Name -ErrorAction Stop
# Service exists, proceed with changing properties
$service | Set-Service -StartupType $StartupType -ErrorAction Stop
}
@ -29,5 +34,5 @@ Function Set-WinUtilService {
Write-Warning "Unable to set $Name due to unhandled exception"
Write-Warning $_.Exception.Message
}
}

View File

@ -1,13 +1,18 @@
function Set-WinUtilUITheme {
<#
.DESCRIPTION
This function will set theme to the XAML file
.EXAMPLE
.SYNOPSIS
Sets the theme of the XAML file
.PARAMETER inputXML
A string representing the XAML object to modify
.PARAMETER themeName
The name of the theme to set the XAML to. Defaults to 'matrix'
.EXAMPLE
Set-WinUtilUITheme -inputXAML $inputXAML
#>
param
(
@ -41,7 +46,7 @@ function Set-WinUtilUITheme {
}
catch {
Write-Warning "Unable to apply theme"
Write-Warning $psitem.Exception.StackTrace
Write-Warning $psitem.Exception.StackTrace
}
return $inputXML;

View File

@ -1,9 +1,15 @@
function Test-WinUtilPackageManager {
<#
.DESCRIPTION
Checks for Winget or Choco depending on the parameter
.SYNOPSIS
Checks if Winget and/or Choco are installed
.PARAMETER winget
Check if Winget is installed
.PARAMETER choco
Check if Chocolatey is installed
#>
Param(

View File

@ -1,10 +1,10 @@
Function Update-WinUtilProgramWinget {
<#
.DESCRIPTION
This will update programs via Winget using a new powershell.exe instance to prevent the GUI from locking up.
.SYNOPSIS
This will update all programs using Winget
#>
[ScriptBlock]$wingetinstall = {