GithubHelp home page GithubHelp logo

starfallprojects / n8n-nodes-powershell Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 2.0 144 KB

This is a custom node for n8n. It allows you to execute PowerShell commands within an n8n workflow.

Home Page: https://www.npmjs.com/package/@starfallprojects/n8n-nodes-powershell

License: MIT License

JavaScript 46.49% TypeScript 53.51%
n8n powershell

n8n-nodes-powershell's Introduction

n8n-nodes-powershell

This is a custom node for n8n. It allows you to execute PowerShell commands within an n8n workflow.

Purpose

n8n provides an Execute Command node, which allows you to execute scripts on your system's default shell. On Windows, this is Command Prompt (cmd). There is currently no option to use PowerShell, other than changing your system's default shell. This node provides an alternative. It copies heavily from the Execute Command node (source for that node is here if you're curious just how blatantly I've copied).

Installation

  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.
  2. Follow the n8n documentation to install community nodes.

Limitations

Not available on Cloud or Desktop

Like the Execute Command node, the PowerShell node won't work on n8n Cloud.

Community nodes are currently unavailable on n8n Desktop.

Requires PowerShell

You must have PowerShell installed on the same machine as n8n.

Limited PowerShell selection

You can choose either PowerShell or PowerShell Core to run your script. The node uses the default installation. This means if you have PowerShell 3.x, 4.x, and 5.x installed, it will automatically use the default. You can't use the node to select an alternative installation. This shouldn't be a problem with PowerShell, as the latest version has good backwards compatibility, but you may need to be aware of differences between the main PowerShell Core versions.

Technical background

This node uses execPromise, an n8n function that promisifies Node.js' child_process.exec(). Refer to the Node.js 16.x documentation for more background.

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.

Note: exec is designed to handle commands with small outputs. Be cautious about using this node for memory-heavy operations.

n8n-nodes-powershell's People

Contributors

per-oestergaard avatar starfallprojects avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.