WebInvokePowerShellBackendt

What is WebInvokePowerShell?

WebInvokePowerShell is a web application which guides users to provide a powershell script file with arguments. When it has collected all data, the script is run.

This is the service part of an eco-system. There are separate backend and frontend. Backend is a C# WCF-application running on an IIS-instance, front is a SPA made with VueJS (running on another IIS-instance). Backend is responsible for the main powershell script performance.

About the Service

The service is a REST-ful C# WCF-application with CORS support.

The service is exposing two methods:

  • http://[BASE_URL]/PowerShellService.svc/GetRegisteredPowerShellScripts_NamesDescriptionsAndParameters. This endpoint accepts [GET] and returns JSON, example:

    [
        {
            "Description": "This script will help users to change several types of addresses",
            "FileNameWithoutPath": "ChangeAddresses.ps1",
            "Name": "ChangeAddresses",
            "Parameters": [
                {
                    "Description": "E-mail",
                    "Name": null
                },
                {
                    "Description": "Office address",
                    "Name": null
                },
                {
                    "Description": "Home address",
                    "Name": null
                },
                {
                    "Description": "Office address",
                    "Name": null
                }
            ]
        },
  • http://[BASE_URL]/PowerShellService.svc/InvokePowerShellScript This endpoint accepts [POST] and returns JSON, example: