update call poweshell
This commit is contained in:
parent
9777afe02d
commit
8ffb07a58c
1 changed files with 11 additions and 6 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue