Portable Tool for an Ideal Windows Setup
C# activatorbloatware-removalcsharpdebloatdebloaterdisable-servicesmonitoring-systemportableprivacy-toolsregistry-tweakssystem-tuningsystem-utilitytelemetrytweakerwindows-10windows-11windows-debloatwindows-defenderwindows-optimizationwindows-tweaks
-args for powershell
Greedeks3e12c2ed3363
diff --git a/.Source/GTweak/Utilities/Helpers/CommandExecutor.cs b/.Source/GTweak/Utilities/Helpers/CommandExecutor.csindex 63cb71a9..b679657c 100644--- a/.Source/GTweak/Utilities/Helpers/CommandExecutor.cs+++ b/.Source/GTweak/Utilities/Helpers/CommandExecutor.cs@@ -13,7 +13,7 @@ namespace GTweak.Utilities.HelpersProcessStartInfo startInfo = new ProcessStartInfo{FileName = isPowerShell ? "powershell.exe" : "cmd.exe",- Arguments = arguments,+ Arguments = isPowerShell ? $"-NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command \"{arguments}\"" : arguments,RedirectStandardOutput = true,RedirectStandardError = true,UseShellExecute = false,@@ -45,7 +45,7 @@ namespace GTweak.Utilities.HelpersProcess.Start(new ProcessStartInfo(){FileName = isPowerShell ? "powershell.exe" : "cmd.exe",- Arguments = arguments,+ Arguments = isPowerShell ? $"-NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command \"{arguments}\"" : arguments,WindowStyle = ProcessWindowStyle.Hidden,CreateNoWindow = true,});diff --git a/.Source/GTweak/Utilities/Tweaks/UninstallingPakages.cs b/.Source/GTweak/Utilities/Tweaks/UninstallingPakages.csindex 0e7c6ddd..2635aade 100644--- a/.Source/GTweak/Utilities/Tweaks/UninstallingPakages.cs+++ b/.Source/GTweak/Utilities/Tweaks/UninstallingPakages.cs@@ -79,6 +79,7 @@ namespace GTweak.Utilities.Tweakstry{var (Alias, IsUnavailable, Scripts) = PackagesDetails[packageName];+ string argument = "-NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command";using Process process = new Process{@@ -92,22 +93,21 @@ namespace GTweak.Utilities.TweaksEnableRaisingEvents = true};- process.StartInfo.Arguments = $"Get-AppxProvisionedPackage -online | where-object {{$_.PackageName -like '*{packageName}*'}} | Remove-AppxProvisionedPackage -alluser -online –Verbose";+ process.StartInfo.Arguments = $"{argument} \"Get-AppxProvisionedPackage -online | where-object {{$_.PackageName -like '*{packageName}*'}} | Remove-AppxProvisionedPackage -alluser -online –Verbose\"";process.Start();process.WaitForExit();foreach (string getScript in Scripts){TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $@"cmd.exe /c for /d %i in (""{pathPackage}\*{getScript}*"") do rd /s /q ""%i""");- process.StartInfo.Arguments = $"Get-AppxPackage -Name {getScript} -AllUsers | Remove-AppxPackage";+ process.StartInfo.Arguments = $"{argument} \"Get-AppxPackage -Name {getScript} -AllUsers | Remove-AppxPackage\"";process.Start();process.WaitForExit();}if (!string.IsNullOrEmpty(Alias)){- process.StartInfo.Arguments = $"Get-AppxProvisionedPackage -online | where-object {{$_.PackageName -like '*{Alias}*'}} | Remove-AppxProvisionedPackage -alluser -online –Verbose";- process.Start();+ process.StartInfo.Arguments = $"{argument} \"Get-AppxProvisionedPackage -online | where-object {{$_.PackageName -like '*{Alias}*'}} | Remove-AppxProvisionedPackage -alluser -online –Verbose\"";process.WaitForExit();}}@@ -134,7 +134,7 @@ namespace GTweak.Utilities.Tweaksbreak;case "Edge":string script = $@"- $region = (Get-ItemProperty -Path 'Registry::HKEY_USERS\.DEFAULT\Control Panel\International\Geo').Name+ $region = 'TE'$policyFile = '{StoragePaths.SystemDisk}Windows\System32\IntegratedServicesRegionPolicySet.json'if (Test-Path $policyFile) {{@@ -162,7 +162,7 @@ namespace GTweak.Utilities.Tweaksexit 1}}";- TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"{Path.Combine(Environment.SystemDirectory, "WindowsPowerShell\\v1.0\\powershell.exe")} {script}");+ TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"{Path.Combine(Environment.SystemDirectory, "WindowsPowerShell\\v1.0\\powershell.exe")} -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command \"{script}\"");foreach (Process process in Process.GetProcessesByName("msedge"))process.Kill();