Skip to content

Commit 1c3e975

Browse files
author
Deborah Barnard
committed
won't do loadOptions;added background to readme
1 parent 811c104 commit 1c3e975

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ n8n provides an Execute Command node, which allows you to execute scripts on you
88

99
## Installation
1010

11-
1. Make sure you have PowerShell installed on the same machine as n8n. The node gives you the option to use either your default PowerShell installation, or your default PowerShell Core installation. You can't currently choose between multiple PowerShell (or PowerShell Core) versions.
11+
1. Make sure you have PowerShell installed on the same machine as n8n. The node gives you the option to use either your default PowerShell installation, or your default PowerShell Core installation. You can't choose between multiple PowerShell (or PowerShell Core) versions.
1212
2. Follow the n8n documentation to [install community nodes](https://docs.n8n.io/integrations/community-nodes/installation/).
1313

1414
## Usage
@@ -17,7 +17,20 @@ n8n provides an Execute Command node, which allows you to execute scripts on you
1717

1818
## Limitations
1919

20+
### Not available on Cloud or Desktop
21+
2022
Like the Execute Command node, the PowerShell node won't work on n8n Cloud.
2123

2224
Community nodes are currently unavailable on n8n Desktop.
2325

26+
###
27+
28+
## Technical background
29+
30+
This node uses `execPromise`, an n8n function that promisifies Node.js' `child_process.exec()`. Refer to the [Node.js 16.x documentation](https://nodejs.org/docs/latest-v16.x/api/child_process.html#child_processexeccommand-options-callback) for more background.
31+
32+
> **Note:** because we're using `exec` rather than `spawn`, there is no option to detach the child process. This means the n8n workflow waits for the PowerShell script to complete before proceeding.
33+
34+
> **Note:** `exec` is designed to handle commands with small outputs. Be cautious about using this node for memory-heavy operations.
35+
36+

nodes/PowerShell/PowerShell.node.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ export class PowerShell implements INodeType {
6262
outputs: ['main'],
6363
properties: [
6464
{
65-
displayName: 'Choose PowerShell type',
65+
displayName: 'Choose PowerShell Type',
6666
name: 'shellChoice',
67-
description: 'Choose PowerShell to use your default full PowerShell installation (probably PowerShell 5), or PowerShell Core to use your default PowerShell Core (PowerShell 6 or 7) installation.',
67+
description: 'Choose PowerShell to use your default full PowerShell installation (probably PowerShell 5), or PowerShell Core to use your default PowerShell Core (PowerShell 6 or 7) installation',
6868
type: 'options',
6969
default: 'powershell.exe',
7070
options: [
@@ -88,7 +88,7 @@ export class PowerShell implements INodeType {
8888
rows: 10,
8989
},
9090
placeholder: 'Write-Output "Hello World"',
91-
description: 'Write a command to execute',
91+
description: 'Write a command to execute',
9292
},
9393
{
9494
displayName: 'Execute Once',
@@ -101,6 +101,8 @@ export class PowerShell implements INodeType {
101101
};
102102

103103

104+
105+
104106
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
105107
let items = this.getInputData();
106108
let command: string;
@@ -151,4 +153,4 @@ export class PowerShell implements INodeType {
151153
return this.prepareOutputData(returnItems);
152154
}
153155

154-
};
156+
}

0 commit comments

Comments
 (0)