Daniel Ehrhardt
Daniel Ehrhardt

Reputation: 1032

Flutter Desktop run Powershell commands

I want to ask if it is possible to run PowerShell Code with Flutter Desktop for Windows. I found the package process_run on pub.dev. With that i can run Shell Commands but i have to do a workaround and start a PowerShell command with that. is there a direct way to send PowerShell commands?

Upvotes: 3

Views: 2678

Answers (1)

Gpack
Gpack

Reputation: 2193

There is an issue on that same repo asking about Powershell

Based on the answer from the repo owner, you may do something like:

// You can run a command
await shell.run('powershell -c "pwd"');
// You can run a power shell script
await shell.run('powershell script.ps1');

Upvotes: 2

Related Questions