Documentation
This commit is contained in:
@@ -1,20 +1,72 @@
|
||||
function New-Session {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
|
||||
Creates new session to phpIPAM instance.
|
||||
|
||||
.DESCRIPTION
|
||||
|
||||
Creates new session to phpIPAM instance by provided credentials or token.
|
||||
|
||||
.PARAMETER URL
|
||||
Base URL of phpIPAM instance.
|
||||
Example - http://ipam.example.com
|
||||
|
||||
.PARAMETER AppID
|
||||
API id (specified in phpIPAM api settings)
|
||||
|
||||
.PARAMETER Token
|
||||
User token foor authorization
|
||||
|
||||
.PARAMETER IgnoreSSL
|
||||
Ignore SSL errors
|
||||
|
||||
.OUTPUTS
|
||||
None. New-Session does not generate any output.
|
||||
#>
|
||||
[CmdletBinding(DefaultParameterSetName="Credentials")]
|
||||
param (
|
||||
[parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true,Position=0)]
|
||||
[parameter(
|
||||
Mandatory=$true,
|
||||
ValueFromPipeline=$true,
|
||||
ValueFromPipelineByPropertyName=$true,
|
||||
Position=0
|
||||
)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[validatescript({$_.startswith("http")})]
|
||||
[string]$URL,
|
||||
[parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true,Position=1)]
|
||||
[parameter(
|
||||
Mandatory=$true,
|
||||
ValueFromPipeline=$true,
|
||||
ValueFromPipelineByPropertyName=$true,
|
||||
Position=1
|
||||
)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$AppID,
|
||||
[parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true,Position=2,ParameterSetName="Credentials")]
|
||||
[parameter(
|
||||
Mandatory=$true,
|
||||
ValueFromPipeline=$true,
|
||||
ValueFromPipelineByPropertyName=$true,
|
||||
Position=2,
|
||||
ParameterSetName="Credentials"
|
||||
)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[pscredential]$Credentials,
|
||||
[parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true,Position=2,ParameterSetName="Token")]
|
||||
[parameter(
|
||||
Mandatory=$true,
|
||||
ValueFromPipeline=$true,
|
||||
ValueFromPipelineByPropertyName=$true,
|
||||
Position=2,
|
||||
ParameterSetName="Token"
|
||||
)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$Token,
|
||||
[parameter(Mandatory=$false,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true,Position=3)]
|
||||
[parameter(
|
||||
Mandatory=$false,
|
||||
ValueFromPipeline=$true,
|
||||
ValueFromPipelineByPropertyName=$true,
|
||||
Position=3
|
||||
)]
|
||||
[switch]$IgnoreSSL = $false
|
||||
)
|
||||
switch ($PSCmdlet.ParameterSetName) {
|
||||
|
||||
Reference in New Issue
Block a user