workflow-app-powershell
Version:
Workflow app for PowerShell
24 lines (21 loc) • 509 B
JavaScript
export const PowerShell = {
type: 'app',
name: 'PowerShell',
params: ['cwd', 'cmd'],
open: async ({ cmd, position }, { platform, startOnPositionByReturnedPid }) => {
if (platform !== 'win32') {
throw new Error('Unsupported platform ' + platform);
}
let args = [];
if (cmd) {
args = ['-NoExit', '-Command', cmd];
} else {
args = ['-NoExit'];
}
await startOnPositionByReturnedPid({
cmd: 'PowerShell.exe',
args,
position,
});
},
};