New-QlikNode.ps1
function New-QlikNode { <# .SYNOPSIS This function ... .DESCRIPTION A bit more description .PARAMETER FromPipeline Shows how to process input from the pipeline, remaining parameters or by named parameter. .EXAMPLE New-QlikNode 'abc' Description of the example. #> <# Enable -Confirm and -WhatIf. #> [CmdletBinding(SupportsShouldProcess = $true)] param( [parameter(Mandatory=$true,Position=0)] [string]$hostname, [string]$name = $hostname, [string]$nodePurpose, [string[]]$customProperties, [string[]]$tags, [alias("engine")] [switch]$engineEnabled, [alias("proxy")] [switch]$proxyEnabled, [alias("scheduler")] [switch]$schedulerEnabled, [alias("printing")] [switch]$printingEnabled ) begin { } process { $json = (@{ configuration=@{ name=$name; hostName=$hostname; engineEnabled=$engineEnabled.IsPresent; proxyEnabled=$proxyEnabled.IsPresent; schedulerEnabled=$schedulerEnabled.IsPresent; printingEnabled=$printingEnabled.IsPresent; } } | ConvertTo-Json -Compress -Depth 10) $container = Invoke-QlikPost "/qrs/servernodeconfiguration/container" $json #Write-Host "http://localhost:4570/certificateSetup" return Invoke-QlikGet "/qrs/servernoderegistration/start/$($container.configuration.id)" } end { } } if ($loadingModule) { Export-ModuleMember -Function 'New-QlikNode' } |