en-us/From_Script_To_Software_Service.Walkthru.help.txt

<#
The most important section of the Pipeworks manifest to understand is WebCommand. Without putting anything in WebCommand, your PowerShell scripts will not be able to be run as software services.
 
 
WebCommand is a hashtable containing the names of the commands you will turn into web services, and arguments to the command [Invoke-WebCommand](/Invoke-WebCommand/). Invoke-WebCommand is the command that runs an individual PowerShell cmdlet as a web service, in all of it's varieties.
 
 
For instance, the [Pipeworks Quickstart](/Pipeworks_Quickstart/) contains a simple example function, Show-HelloMessage, and this simple command to create a Pipeworks manifest and run it.
 
#>
 
New-PipeworksManifest -Name SayHello -WebCommand @{
    "Show-HelloMessage" = @{
        FriendlyName = 'Say Hello'
    }
}
 
 
<#
 
Invoke-WebCommand has many options. One of the most common needs to be able to run a command without any input (for instance, running a getter)
 
#>
 
 
New-PipeworksManifest -Name GetStuff -WebCommand @{
    "Get-Something" = @{
        FriendlyName = 'Get Stuff'
        RunWithoutInput = $true
    }
}
 
 
<#
 
Another common need is authentication. To require that someone is logged in before they run the command, you can use RequireLogin
#>
 
New-PipeworksManifest -Name GetMyStuff -WebCommand @{
    "Get-MyThing" = @{
        FriendlyName = 'Get My Stuff'
        RunWithoutInput = $true
        RequireLogin = $true
    }
}
 
 
<#
 
You might want to avoid them seeing a private command at all. To do this, use IfLoggedInAs='*'
#>
 
New-PipeworksManifest -Name GetMyStuff -WebCommand @{
    "Get-MyThing" = @{
        FriendlyName = 'Get My Stuff'
        RunWithoutInput = $true
        IfLoggedInAs = '*'
    }
}
 
 
<#
 
It's also possible to hide a command from the normal view. This is great for fine-tuning your front-end experience, so it's not overloaded with every script.
 
#>
 
New-PipeworksManifest -Name GetMyStuff -WebCommand @{
    "Get-MyThing" = @{
        FriendlyName = 'Get My Stuff'
        RunWithoutInput = $true
        Hidden = $true
    }
}