GithubHelp home page GithubHelp logo

pa-0 / new-psservice Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oze4/new-psservice

1.0 0.0 0.0 256 KB

Turn any looping .ps1 script into a Windows Service.

License: MIT License

PowerShell 100.00%

new-psservice's Introduction

ScriptAsService

Turn any looping .ps1 script into a Windows Service With the help of the included Sorlov Assemblies (https://twitter.com/sorlov/status/515149451691044864).

THANK YOU DANIEL SORLOV!

Installation

To install this module, simply run:

Install-Module -Name ScriptAsService

Example

For an example of how to use the module, clone the project locally and open an elevated PowerShell Prompt in the cloned folder (or cd into the cloned folder once you've opened PowerShell):

.\Examples\Basic-Example.ps1

This will create an executable, install it as a service, and verify the output. Essentially, the service will just write the current time to a log file every ten seconds.

To clean up after the example, run the following from the same prompt:

.\Examples\Basic-Cleanup.ps1

Build Locally From Source

Once you've cloned this project, open a PowerShell prompt and set the root folder of this project as your current directory. Then:

Invoke-Psake -buildFile .\psake.ps1 -taskList Build

This will build a folder, ScriptAsService in the current directory. In that folder is a versioned folder containing the module. You should be able to copy this folder to your Module Path if you want, or import the module via path.

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.