From bcc5b691d6ea7e2f4ec6cc0de829ae71900bc633 Mon Sep 17 00:00:00 2001 From: Martin Wiethan <47688561+Marterich@users.noreply.github.com> Date: Fri, 10 May 2024 06:05:04 +0200 Subject: [PATCH] Include OOSU Config in winutil.ps1 (#1932) --- Compile.ps1 | 3 +++ functions/public/Invoke-WPFOOSU | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Compile.ps1 b/Compile.ps1 index 330c226a..2f568499 100644 --- a/Compile.ps1 +++ b/Compile.ps1 @@ -55,6 +55,9 @@ Get-ChildItem .\config | Where-Object {$psitem.extension -eq ".json"} | ForEach- $sync.configs.$($psitem.BaseName) = $json | convertfrom-json Write-output "`$sync.configs.$($psitem.BaseName) = '$json' `| convertfrom-json" | Out-File ./$scriptname -Append -Encoding ascii } +Get-ChildItem .\config | Where-Object {$PSItem.Extension -eq ".cfg"} | ForEach-Object { + Write-output "`$sync.configs.$($psitem.BaseName) = '$(Get-Content $PSItem.FullName)'" | Out-File ./$scriptname -Append -Encoding ascii +} $xaml = (Get-Content .\xaml\inputXML.xaml).replace("'","''") diff --git a/functions/public/Invoke-WPFOOSU b/functions/public/Invoke-WPFOOSU index d30ea3a8..d244acf2 100644 --- a/functions/public/Invoke-WPFOOSU +++ b/functions/public/Invoke-WPFOOSU @@ -27,14 +27,12 @@ function Invoke-WPFOOSU { Start-Process $OOSU_filepath } "recommended"{ - $oosu_config = "$ENV:temp\ooshutup10_recommended.cfg" - Invoke-WebRequest -Uri "https://raw.githubusercontent.com/ChrisTitusTech/winutil/main/config/ooshutup10_recommended.cfg" -OutFile $oosu_config + New-Item -Path $ENV:temp\ooshutup10_recommended.cfg -ItemType File -Value $sync.configs.ooshutup10_recommended -Force Write-Host "Applying recommended OO Shutup 10 Policies" Start-Process $OOSU_filepath -ArgumentList "$oosu_config /quiet" -Wait } "undo"{ - $oosu_config = "$ENV:temp\ooshutup10_factory.cfg" - Invoke-WebRequest -Uri "https://raw.githubusercontent.com/ChrisTitusTech/winutil/main/config/ooshutup10_factory.cfg" -OutFile $oosu_config + New-Item -Path $ENV:temp\ooshutup10_factory.cfg -ItemType File -Value $sync.configs.ooshutup10_factory -Force Write-Host "Resetting all OO Shutup 10 Policies" Start-Process $OOSU_filepath -ArgumentList "$oosu_config /quiet" -Wait }