mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-12-22 05:51:30 -06:00
Test 2024 01 02 Main Merge (#1345)
* Add Version to App Display * Keep Windows Security (#1341) Adds a switch to Remove-ProvisionedPackages to determine whether we should remove Windows Security (GUI component, Microsoft.SecHealthUI). This commit fixes issue #1339 * Added scrollbar to all tabs (#1344) * Add scrollbar to Tweaks * Added scrollbar to all tabs * Compile Winutil --------- Co-authored-by: CodingWonders <101426328+CodingWonders@users.noreply.github.com> Co-authored-by: Munkk <152475628+munkk01@users.noreply.github.com> Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com>
This commit is contained in:
parent
771c268130
commit
a2b12ae4b0
@ -23,8 +23,9 @@ Get-ChildItem .\functions -Recurse -File | ForEach-Object {
|
|||||||
|
|
||||||
Get-ChildItem .\xaml | ForEach-Object {
|
Get-ChildItem .\xaml | ForEach-Object {
|
||||||
$xaml = (Get-Content $psitem.FullName).replace("'","''")
|
$xaml = (Get-Content $psitem.FullName).replace("'","''")
|
||||||
|
$newXaml = $xaml -replace 'CTTVersion', (Get-Date -Format 'yy.MM.dd')
|
||||||
|
|
||||||
Write-output "`$$($psitem.BaseName) = '$xaml'" | Out-File ./$scriptname -Append -Encoding ascii
|
Write-output "`$$($psitem.BaseName) = '$newXaml'" | Out-File ./$scriptname -Append -Encoding ascii
|
||||||
}
|
}
|
||||||
|
|
||||||
Get-ChildItem .\config | Where-Object {$psitem.extension -eq ".json"} | ForEach-Object {
|
Get-ChildItem .\config | Where-Object {$psitem.extension -eq ".json"} | ForEach-Object {
|
||||||
|
@ -90,8 +90,20 @@ function Remove-Packages
|
|||||||
Write-Progress -Activity "Removing Apps" -Status "Ready" -Completed
|
Write-Progress -Activity "Removing Apps" -Status "Ready" -Completed
|
||||||
}
|
}
|
||||||
|
|
||||||
function Remove-ProvisionedPackages
|
function Remove-ProvisionedPackages([switch] $keepSecurity = $false)
|
||||||
{
|
{
|
||||||
|
<#
|
||||||
|
|
||||||
|
.SYNOPSIS
|
||||||
|
Removes AppX packages from a Windows image during MicroWin processing
|
||||||
|
|
||||||
|
.PARAMETER Name
|
||||||
|
keepSecurity - Boolean that determines whether to keep "Microsoft.SecHealthUI" (Windows Security) in the Windows image
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Remove-ProvisionedPackages -keepSecurity:$false
|
||||||
|
|
||||||
|
#>
|
||||||
$appxProvisionedPackages = Get-AppxProvisionedPackage -Path "$($scratchDir)" | Where-Object {
|
$appxProvisionedPackages = Get-AppxProvisionedPackage -Path "$($scratchDir)" | Where-Object {
|
||||||
$_.PackageName -NotLike "*AppInstaller*" -AND
|
$_.PackageName -NotLike "*AppInstaller*" -AND
|
||||||
$_.PackageName -NotLike "*Store*" -and
|
$_.PackageName -NotLike "*Store*" -and
|
||||||
@ -107,6 +119,7 @@ function Remove-ProvisionedPackages
|
|||||||
|
|
||||||
if ($?)
|
if ($?)
|
||||||
{
|
{
|
||||||
|
if ($keepSecurity) { $appxProvisionedPackages = $appxProvisionedPackages | Where-Object { $_.PackageName -NotLike "*SecHealthUI*" }}
|
||||||
$counter = 0
|
$counter = 0
|
||||||
foreach ($appx in $appxProvisionedPackages)
|
foreach ($appx in $appxProvisionedPackages)
|
||||||
{
|
{
|
||||||
|
@ -63,7 +63,7 @@ function Invoke-WPFMicrowin {
|
|||||||
}
|
}
|
||||||
if (!$keepProvisionedPackages)
|
if (!$keepProvisionedPackages)
|
||||||
{
|
{
|
||||||
Remove-ProvisionedPackages
|
Remove-ProvisionedPackages -keepSecurity:$keepDefender
|
||||||
}
|
}
|
||||||
|
|
||||||
# special code, for some reason when you try to delete some inbox apps
|
# special code, for some reason when you try to delete some inbox apps
|
||||||
|
32
winutil.ps1
32
winutil.ps1
@ -10,7 +10,7 @@
|
|||||||
Author : Chris Titus @christitustech
|
Author : Chris Titus @christitustech
|
||||||
Runspace Author: @DeveloperDurp
|
Runspace Author: @DeveloperDurp
|
||||||
GitHub : https://github.com/ChrisTitusTech
|
GitHub : https://github.com/ChrisTitusTech
|
||||||
Version : 24.01.02
|
Version : 24.01.03
|
||||||
#>
|
#>
|
||||||
|
|
||||||
Start-Transcript $ENV:TEMP\Winutil.log -Append
|
Start-Transcript $ENV:TEMP\Winutil.log -Append
|
||||||
@ -22,7 +22,7 @@ Add-Type -AssemblyName System.Windows.Forms
|
|||||||
# Variable to sync between runspaces
|
# Variable to sync between runspaces
|
||||||
$sync = [Hashtable]::Synchronized(@{})
|
$sync = [Hashtable]::Synchronized(@{})
|
||||||
$sync.PSScriptRoot = $PSScriptRoot
|
$sync.PSScriptRoot = $PSScriptRoot
|
||||||
$sync.version = "24.01.02"
|
$sync.version = "24.01.03"
|
||||||
$sync.configs = @{}
|
$sync.configs = @{}
|
||||||
$sync.ProcessRunning = $false
|
$sync.ProcessRunning = $false
|
||||||
|
|
||||||
@ -1121,8 +1121,20 @@ function Remove-Packages
|
|||||||
Write-Progress -Activity "Removing Apps" -Status "Ready" -Completed
|
Write-Progress -Activity "Removing Apps" -Status "Ready" -Completed
|
||||||
}
|
}
|
||||||
|
|
||||||
function Remove-ProvisionedPackages
|
function Remove-ProvisionedPackages([switch] $keepSecurity = $false)
|
||||||
{
|
{
|
||||||
|
<#
|
||||||
|
|
||||||
|
.SYNOPSIS
|
||||||
|
Removes AppX packages from a Windows image during MicroWin processing
|
||||||
|
|
||||||
|
.PARAMETER Name
|
||||||
|
keepSecurity - Boolean that determines whether to keep "Microsoft.SecHealthUI" (Windows Security) in the Windows image
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Remove-ProvisionedPackages -keepSecurity:$false
|
||||||
|
|
||||||
|
#>
|
||||||
$appxProvisionedPackages = Get-AppxProvisionedPackage -Path "$($scratchDir)" | Where-Object {
|
$appxProvisionedPackages = Get-AppxProvisionedPackage -Path "$($scratchDir)" | Where-Object {
|
||||||
$_.PackageName -NotLike "*AppInstaller*" -AND
|
$_.PackageName -NotLike "*AppInstaller*" -AND
|
||||||
$_.PackageName -NotLike "*Store*" -and
|
$_.PackageName -NotLike "*Store*" -and
|
||||||
@ -1138,6 +1150,7 @@ function Remove-ProvisionedPackages
|
|||||||
|
|
||||||
if ($?)
|
if ($?)
|
||||||
{
|
{
|
||||||
|
if ($keepSecurity) { $appxProvisionedPackages = $appxProvisionedPackages | Where-Object { $_.PackageName -NotLike "*SecHealthUI*" }}
|
||||||
$counter = 0
|
$counter = 0
|
||||||
foreach ($appx in $appxProvisionedPackages)
|
foreach ($appx in $appxProvisionedPackages)
|
||||||
{
|
{
|
||||||
@ -2640,7 +2653,7 @@ function Invoke-WPFMicrowin {
|
|||||||
}
|
}
|
||||||
if (!$keepProvisionedPackages)
|
if (!$keepProvisionedPackages)
|
||||||
{
|
{
|
||||||
Remove-ProvisionedPackages
|
Remove-ProvisionedPackages -keepSecurity:$keepDefender
|
||||||
}
|
}
|
||||||
|
|
||||||
# special code, for some reason when you try to delete some inbox apps
|
# special code, for some reason when you try to delete some inbox apps
|
||||||
@ -4263,12 +4276,15 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
|
|||||||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Segoe MDL2 Assets"
|
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Segoe MDL2 Assets"
|
||||||
FontSize="14" Margin="16,0,0,0"></TextBlock>
|
FontSize="14" Margin="16,0,0,0"></TextBlock>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<TextBlock Text="Version: 24.01.03" VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||||
|
Margin="10,0,0,0"/>
|
||||||
<Button Content="×" BorderThickness="0"
|
<Button Content="×" BorderThickness="0"
|
||||||
BorderBrush="Transparent"
|
BorderBrush="Transparent"
|
||||||
Background="{MainBackgroundColor}"
|
Background="{MainBackgroundColor}"
|
||||||
HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,5,5,0"
|
HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,5,5,0"
|
||||||
FontFamily="Arial"
|
FontFamily="Arial"
|
||||||
Foreground="{MainForegroundColor}" FontSize="18" Name="WPFCloseButton" />
|
Foreground="{MainForegroundColor}" FontSize="18" Name="WPFCloseButton" />
|
||||||
|
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
|
||||||
<TabControl Name="WPFTabNav" Background="Transparent" Width="Auto" Height="Auto" BorderBrush="Transparent" BorderThickness="0" Grid.Row="1" Grid.Column="0" Padding="-1">
|
<TabControl Name="WPFTabNav" Background="Transparent" Width="Auto" Height="Auto" BorderBrush="Transparent" BorderThickness="0" Grid.Row="1" Grid.Column="0" Padding="-1">
|
||||||
@ -4333,6 +4349,7 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
|
|||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="Tweaks" Visibility="Collapsed" Name="WPFTab2">
|
<TabItem Header="Tweaks" Visibility="Collapsed" Name="WPFTab2">
|
||||||
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||||
<Grid Background="Transparent">
|
<Grid Background="Transparent">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width=".50*"/>
|
<ColumnDefinition Width=".50*"/>
|
||||||
@ -4461,8 +4478,10 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
|
|||||||
</StackPanel> <!-- End of Customize Preferences Section -->
|
</StackPanel> <!-- End of Customize Preferences Section -->
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="Config" Visibility="Collapsed" Name="WPFTab3">
|
<TabItem Header="Config" Visibility="Collapsed" Name="WPFTab3">
|
||||||
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||||
<Grid Background="Transparent">
|
<Grid Background="Transparent">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
@ -4499,8 +4518,10 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="Updates" Visibility="Collapsed" Name="WPFTab4">
|
<TabItem Header="Updates" Visibility="Collapsed" Name="WPFTab4">
|
||||||
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||||
<Grid Background="Transparent">
|
<Grid Background="Transparent">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
@ -4527,8 +4548,10 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="MicroWin" Visibility="Collapsed" Name="WPFTab5" Width="Auto" Height="Auto">
|
<TabItem Header="MicroWin" Visibility="Collapsed" Name="WPFTab5" Width="Auto" Height="Auto">
|
||||||
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||||
<Grid Width="Auto" Height="Auto">
|
<Grid Width="Auto" Height="Auto">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
@ -4673,6 +4696,7 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</TabControl>
|
</TabControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
@ -571,12 +571,15 @@
|
|||||||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Segoe MDL2 Assets"
|
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Segoe MDL2 Assets"
|
||||||
FontSize="14" Margin="16,0,0,0"></TextBlock>
|
FontSize="14" Margin="16,0,0,0"></TextBlock>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<TextBlock Text="Version: CTTVersion" VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||||
|
Margin="10,0,0,0"/>
|
||||||
<Button Content="×" BorderThickness="0"
|
<Button Content="×" BorderThickness="0"
|
||||||
BorderBrush="Transparent"
|
BorderBrush="Transparent"
|
||||||
Background="{MainBackgroundColor}"
|
Background="{MainBackgroundColor}"
|
||||||
HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,5,5,0"
|
HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,5,5,0"
|
||||||
FontFamily="Arial"
|
FontFamily="Arial"
|
||||||
Foreground="{MainForegroundColor}" FontSize="18" Name="WPFCloseButton" />
|
Foreground="{MainForegroundColor}" FontSize="18" Name="WPFCloseButton" />
|
||||||
|
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
|
||||||
<TabControl Name="WPFTabNav" Background="Transparent" Width="Auto" Height="Auto" BorderBrush="Transparent" BorderThickness="0" Grid.Row="1" Grid.Column="0" Padding="-1">
|
<TabControl Name="WPFTabNav" Background="Transparent" Width="Auto" Height="Auto" BorderBrush="Transparent" BorderThickness="0" Grid.Row="1" Grid.Column="0" Padding="-1">
|
||||||
@ -641,6 +644,7 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="Tweaks" Visibility="Collapsed" Name="WPFTab2">
|
<TabItem Header="Tweaks" Visibility="Collapsed" Name="WPFTab2">
|
||||||
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||||
<Grid Background="Transparent">
|
<Grid Background="Transparent">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width=".50*"/>
|
<ColumnDefinition Width=".50*"/>
|
||||||
@ -769,8 +773,10 @@
|
|||||||
</StackPanel> <!-- End of Customize Preferences Section -->
|
</StackPanel> <!-- End of Customize Preferences Section -->
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="Config" Visibility="Collapsed" Name="WPFTab3">
|
<TabItem Header="Config" Visibility="Collapsed" Name="WPFTab3">
|
||||||
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||||
<Grid Background="Transparent">
|
<Grid Background="Transparent">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
@ -807,8 +813,10 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="Updates" Visibility="Collapsed" Name="WPFTab4">
|
<TabItem Header="Updates" Visibility="Collapsed" Name="WPFTab4">
|
||||||
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||||
<Grid Background="Transparent">
|
<Grid Background="Transparent">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
@ -835,8 +843,10 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="MicroWin" Visibility="Collapsed" Name="WPFTab5" Width="Auto" Height="Auto">
|
<TabItem Header="MicroWin" Visibility="Collapsed" Name="WPFTab5" Width="Auto" Height="Auto">
|
||||||
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||||
<Grid Width="Auto" Height="Auto">
|
<Grid Width="Auto" Height="Auto">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
@ -981,6 +991,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</TabControl>
|
</TabControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
Loading…
Reference in New Issue
Block a user