mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-15 15:15:51 -06:00
4a7c8a35bf
* Remove the Non-existing 'WPFMiscTweaksPower' found in the 'preset.json' File (#1763) * Compile Winutil * Update of Test-WinUtilPackageManager and Install-WinUtilWinget (#1757) * Updated Install-WinUtilWinget and Test-WinUtilPackageManager - Updated Test-WinUtilPackageManager to better handle the -Winget param and return a more verbose status. - Moved many of the "is installed"/"is not installed" outputs to the Test-WinUtilPackageManager function. - Changed Install-WinUtilWinget to use the GitHub install method as the primary method, and on error use the Chocolatey install method. - Updated various functions to use the Test-WinUtilPackageManager function. * Update Install-WinUtilWinget.ps1 - Changed handling of Test-WinUtilPackageManager in Install-WinUtilWinget, to prevent Test-WinUtilPackageManager from printing out to terminal twice. * Compile Winutil * Update Paint.NET Winget name. (#1758) Paint.NET's winget package name changed. * Compile Winutil * Fixed Programms names and urls and github actions (#1759) * Compile Winutil * trying to fix github actions * Update applications.json * Compile Winutil * updated winget package PaintDotNet * Compile Winutil * Update functions.Tests.ps1 * fixing typos in unittesting * fixed the issue that made pester not to work * Compile Winutil * found a bug and fixed it * Compile Winutil --------- Co-authored-by: YusufKhalifadev <YusufKhalifadev@users.noreply.github.com> * Detect free space of installation drive and compare it with the ISO size and delete temporary MicroWin files from previous runs (#1761) * Detect free space of installation drive Compare the size of the ISO file with the free space of the installation drive (or the drive containing the User files) and, if the free size is below a certain threshold, the script will throw either a warning or an error * Delete temporary files from previous runs * Add Simple Feature to keep the Service Startup upon Applying Service Tweaks, but not when Undoing it (#1760) Added a new parameter that gives freedom of control on whether to disable this feature or not, and of course the simple feature in question. The way it works is by Getting the service using its name, and see if the Startup Value of this service is equal to the default type that Windows comes with it, if not (The User has changed it in the past), then WinUtil won't change it by default (The KeepServiceStartup is true by default), this is a more desirable behaviour when compared to how it previously worked. These changes were tested by the Author of this commit, Please read the commit patches for exact details on the changes. * Compile Winutil * Sacrifice to the AV Gods Remove Self Elevation and Disable UAC --------- Co-authored-by: Mr.k <mineshtine28546271@gmail.com> Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com> Co-authored-by: Rux <jonathan.e.rux@ruxunderscore.com> Co-authored-by: YusufKhalifadev <yusufkhalifadev@gmail.com> Co-authored-by: YusufKhalifadev <YusufKhalifadev@users.noreply.github.com> Co-authored-by: CodingWonders <101426328+CodingWonders@users.noreply.github.com>
64 lines
1.6 KiB
PowerShell
64 lines
1.6 KiB
PowerShell
<#
|
|
.NOTES
|
|
Author : Chris Titus @christitustech
|
|
Runspace Author: @DeveloperDurp
|
|
GitHub : https://github.com/ChrisTitusTech
|
|
Version : #{replaceme}
|
|
#>
|
|
param (
|
|
[switch]$Debug,
|
|
[string]$Config,
|
|
[switch]$Run
|
|
)
|
|
|
|
# Set DebugPreference based on the -Debug switch
|
|
if ($Debug) {
|
|
$DebugPreference = "Continue"
|
|
}
|
|
|
|
if ($Config) {
|
|
$PARAM_CONFIG = $Config
|
|
}
|
|
|
|
$PARAM_RUN = $false
|
|
# Handle the -Run switch
|
|
if ($Run) {
|
|
Write-Host "Running config file tasks..."
|
|
$PARAM_RUN = $true
|
|
}
|
|
|
|
if (!(Test-Path -Path $ENV:TEMP)) {
|
|
New-Item -ItemType Directory -Force -Path $ENV:TEMP
|
|
}
|
|
|
|
Start-Transcript $ENV:TEMP\Winutil.log -Append
|
|
|
|
# Load DLLs
|
|
Add-Type -AssemblyName PresentationFramework
|
|
Add-Type -AssemblyName System.Windows.Forms
|
|
|
|
# Variable to sync between runspaces
|
|
$sync = [Hashtable]::Synchronized(@{})
|
|
$sync.PSScriptRoot = $PSScriptRoot
|
|
$sync.version = "#{replaceme}"
|
|
$sync.configs = @{}
|
|
$sync.ProcessRunning = $false
|
|
|
|
$currentPid = [System.Security.Principal.WindowsIdentity]::GetCurrent()
|
|
$principal = new-object System.Security.Principal.WindowsPrincipal($currentPid)
|
|
$adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator
|
|
|
|
|
|
if ($principal.IsInRole($adminRole))
|
|
{
|
|
$Host.UI.RawUI.WindowTitle = $myInvocation.MyCommand.Definition + "(Admin)"
|
|
clear-host
|
|
}
|
|
else
|
|
{
|
|
Write-Host "===========================================" -Foregroundcolor Red
|
|
Write-Host "-- Scripts must be run as Administrator ---" -Foregroundcolor Red
|
|
Write-Host "-- Right-Click Start -> Terminal(Admin) ---" -Foregroundcolor Red
|
|
Write-Host "===========================================" -Foregroundcolor Red
|
|
break
|
|
} |