runPowershell function

Future<String?> runPowershell(
  1. String command
)

Implementation

Future<String?> runPowershell(String command) async {
  final result = await Process.run('powershell', [
    '-NoProfile',
    '-ExecutionPolicy',
    'Bypass',
    '-Command',
    command,
  ]);
  if (result.exitCode == 0) {
    return null;
  }
  return result.stderr;
}