workflow-app-powershell
Version:
Workflow app for PowerShell
30 lines (24 loc) • 613 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
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
});
}
};
exports.PowerShell = PowerShell;