diff --git a/lib/platform/process.dart b/lib/platform/process.dart index a11a4e1..de29f1b 100644 --- a/lib/platform/process.dart +++ b/lib/platform/process.dart @@ -134,14 +134,17 @@ class ProcessExecutor { if (result.exitCode == 0) { var path = result.stdout.toString().split('\n')[0]; _powershellPath = File(path).absolute.path; + print(_powershellPath); } if (_powershellPath.isEmpty) { throw UnsupportedError('Not found powershell'); } result = await Process.run( - _powershellPath, + 'cmd', [ + '/C', + 'powershell', '-Command', 'Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned' ], @@ -234,9 +237,11 @@ class ProcessExecutor { file.createSync(); file.writeAsStringSync(shell.toString(), flush: true); + var powershell = await getPowershell(); + print(powershell); try { - processData.process = await Process.start(await getPowershell(), - ['-NoProfile', '-File', file.absolute.path]); + processData.process = await Process.start('cmd', + ['/C', 'powershell', '-NoProfile', '-File', file.absolute.path]); } on Exception catch (e) { logHandler ?? (e, LogType.error); } @@ -294,11 +299,11 @@ class ProcessExecutor { print(file.absolute.path); - await getPowershell(); + var powshell = await getPowershell(); processResult = await Process.run( - await getPowershell(), // PowerShell 실행 - ['-NoProfile', '-File', file.absolute.path], + 'cmd', // PowerShell 실행 + ['/C', 'powershell', '-NoProfile', '-File', file.absolute.path], runInShell: true); file.deleteSync();