File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -153,8 +153,8 @@ class SecurityServiceImpl implements SecurityService {
153153
154154 await WinPackageService .uninstallPackage (WinPackageType .defenderRemoval);
155155
156- await shell. run (
157- 'start /WAIT /MIN /B "" "%systemroot% \\ System32\\ gpupdate.exe" /Target:Computer /Force' ,
156+ await runPSCommand (
157+ "& \$ env:SystemRoot \\ System32\\ gpupdate.exe /Target:Computer /Force" ,
158158 );
159159
160160 await Future .wait ([
@@ -347,8 +347,8 @@ class SecurityServiceImpl implements SecurityService {
347347 ),
348348 ]);
349349
350- await shell. run (
351- 'start /WAIT /MIN /B "" "%systemroot% \\ System32\\ gpupdate.exe" /Target:Computer /Force' ,
350+ await runPSCommand (
351+ "& \$ env:SystemRoot \\ System32\\ gpupdate.exe /Target:Computer /Force" ,
352352 );
353353
354354 if (File (_mpCmdRunString).existsSync ()) {
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ bool isProcessRunning(String name) {
8585}
8686
8787/// PowerShell helper for executing commands with faster startup time
88- Future <String > runPSCommand (String command) async {
88+ Future <String > runPSCommand (String command, { bool stdout = false } ) async {
8989 final result = await Process .run ('powershell' , [
9090 '-NoProfile' ,
9191 '-NonInteractive' ,
@@ -107,7 +107,7 @@ Future<String> runPSCommand(String command) async {
107107 result.exitCode,
108108 );
109109 }
110- logger.i ('ps_command: $command ' );
110+ logger.i ('ps_command: $command ; ${ stdout ? result . stdout : '' } ' );
111111
112112 return result.stdout.toString ();
113113}
You can’t perform that action at this time.
0 commit comments