Delete Temp Files Addition

This commit is contained in:
Chris Titus 2022-09-25 13:44:14 -05:00
parent ff694a5d6b
commit f272200c10

View File

@ -536,6 +536,7 @@ $WPFInstallUpgrade.Add_Click({
$WPFdesktop.Add_Click({
$WPFEssTweaksAH.IsChecked = $true
$WPFEssTweaksDeleteTempFiles.IsChecked = $true
$WPFEssTweaksDeBloat.IsChecked = $false
$WPFEssTweaksDVR.IsChecked = $true
$WPFEssTweaksHiber.IsChecked = $true
@ -556,6 +557,7 @@ $WPFdesktop.Add_Click({
$WPFlaptop.Add_Click({
$WPFEssTweaksAH.IsChecked = $true
$WPFEssTweaksDeleteTempFiles.IsChecked = $true
$WPFEssTweaksDeBloat.IsChecked = $false
$WPFEssTweaksDVR.IsChecked = $true
$WPFEssTweaksHiber.IsChecked = $false
@ -576,6 +578,7 @@ $WPFlaptop.Add_Click({
$WPFminimal.Add_Click({
$WPFEssTweaksAH.IsChecked = $false
$WPFEssTweaksDeleteTempFiles.IsChecked = $false
$WPFEssTweaksDeBloat.IsChecked = $false
$WPFEssTweaksDVR.IsChecked = $false
$WPFEssTweaksHiber.IsChecked = $false
@ -603,6 +606,13 @@ $WPFtweaksbutton.Add_Click({
$WPFEssTweaksAH.IsChecked = $false
}
If ( $WPFEssTweaksDeleteTempFiles.IsChecked -eq $true ) {
Write-Host "Delete Temp Files"
Get-ChildItem -Path "C:\Windows\Temp" *.* -Recurse | Remove-Item -Force -Recurse
Get-ChildItem -Path $env:TEMP *.* -Recurse | Remove-Item -Force -Recurse
$WPFEssTweaksDeleteTempFiles.IsChecked = $false
}
If ( $WPFEssTweaksDVR.IsChecked -eq $true ) {
If (!(Test-Path "HKCU:\System\GameConfigStore")) {
Set-ItemProperty -Path "HKCU:\System\GameConfigStore" -Name "GameDVR_DXGIHonorFSEWindowsCompatible" -Type Hex -Value 00000000