【发布时间】:2021-05-30 23:56:22
【问题描述】:
我想问一下是否可以使用 Flutter Desktop for Windows 运行 PowerShell 代码。 我在 pub.dev 上找到了包 process_run。 有了它,我可以运行 Shell 命令,但我必须做一个解决方法并用它启动一个 PowerShell 命令。 有没有直接发送 PowerShell 命令的方法?
【问题讨论】:
标签: flutter
我想问一下是否可以使用 Flutter Desktop for Windows 运行 PowerShell 代码。 我在 pub.dev 上找到了包 process_run。 有了它,我可以运行 Shell 命令,但我必须做一个解决方法并用它启动一个 PowerShell 命令。 有没有直接发送 PowerShell 命令的方法?
【问题讨论】:
标签: flutter
在同一个仓库中有一个issue 询问有关 Powershell 的问题
根据回购所有者的回答,您可以执行以下操作:
// You can run a command
await shell.run('powershell -c "pwd"');
// You can run a power shell script
await shell.run('powershell script.ps1');
【讨论】: