You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, is this possile to run powershell or other terminal in shell ? , it's seem like shell we are using on Windows is command prompt and I want run powershell on it by using run powershell or powershell.exe , since command on powershell is more similar to default terminal on Mac OS or Linux so I don't have to switch case base on the OS
I try and it open powershell successfully but after that I can't run any command on it, the controller don't send any event after I run powershell
I have looked this issue #29 , he could use powershell to send OS notification on Windows debug mode but only push once on release mode
My code:
void test() async {
controller.stream.listen((event) {
print(event);
});
try {
await shell.run('powershell.exe');
await shell.run('pwd');
} on ShellException catch (e) {
// We might get a shell exception
log('error');
log(e.result.stderr);
}
}
The text was updated successfully, but these errors were encountered:
Shell is not a command prompt nor a scripting language, it only allows calling native binaries like you do in a console. And yes there are differences between platforms. However commands don't maintain a state, i.e. the command pwd in your example is not ran in the context of the previous powsershell.exe.
One solution is to call powershell with a list of command, or a script:
// You can run a commandawait shell.run('powershell -c "pwd"');
// You can run a power shell scriptawait shell.run('powershell script.ps1');
Hi, is this possile to run powershell or other terminal in shell ? , it's seem like shell we are using on Windows is command prompt and I want run powershell on it by using run
powershell
orpowershell.exe
, since command on powershell is more similar to default terminal on Mac OS or Linux so I don't have to switch case base on the OSI try and it open powershell successfully but after that I can't run any command on it, the controller don't send any event after I run
powershell
I have looked this issue #29 , he could use powershell to send OS notification on Windows debug mode but only push once on release mode
My code:
The text was updated successfully, but these errors were encountered: