# Install-NodeService.ps1

**URL:** <https://discourse.nodered.org/t/install-nodeservice-ps1/19800>\
**Category:** Share Your Projects\
**Created:** [1 January 2020 20:38 UTC](https://discourse.nodered.org/t/install-nodeservice-ps1/19800 "2020-01-01T20:38:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![iOnline247](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ionline247/32/15634_2.png) [@iOnline247](https://discourse.nodered.org/u/iOnline247)\
**Post date:** [1 January 2020 20:38 UTC](https://discourse.nodered.org/t/install-nodeservice-ps1/19800/1 "2020-01-01T20:38:33Z")

</div>

I've built a PowerShell script that will install any NodeJS application as a Windows Service. I've used it on several projects and is working pretty nice. I'm going to try and make a version that is PSCore & .NET Core compatible, so I can get it to work on \*Nix as well.

> **[iOnline247/Install-NodeService](https://github.com/iOnline247/Install-NodeService)**
>
> Installs Windows Service and monitors the NodeJS Application. - iOnline247/Install-NodeService

Edit: I think it might be helpful to add a working example. 😉

```auto
Install-NodeService -ServiceName "NodeRED-DEV" -InstallPath 'C:\Users\mbramer\Documents\Node-RED-DEV\node_modules\node-red' -ScriptPath "C:\Users\mbramer\Documents\Node-RED-DEV\node_modules\node-red\red.js" -RuntimeArgs "--harmony" -ScriptArgs @("--port", "1881", "--userDir", "C:\Users\mbramer\Documents\Node-RED-DEV\config")

```

You'll want to make sure the `config` folder exists first, since it's being passed in as the `--userDir`.
