public/New-DuoIntegration.ps1
|
<#
.Synopsis create new application .DESCRIPTION .EXAMPLE New-DuoIntegration .EXAMPLE .INPUTS .OUTPUTS [PSCustomObject]DuoRequest .NOTES .COMPONENT PSDuo .FUNCTIONALITY #> function New-DuoIntegration { [cmdletbinding()] param( [parameter(Mandatory = $true)] [String]$name, [parameter(Mandatory = $true)] [ValidateSet("rdp", "adfs", 'websdk')] [String]$type ) [string]$method = "POST" [string]$path = '/admin/v1/integrations' $APiParams = $MyInvocation.BoundParameters $DuoRequest = Convertto-DUORequest -DuoMethodPath $path -Method $method -ApiParams $ApiParams $Response = Invoke-RestMethod @DuoRequest -SkipHeaderValidation:$true If ($Response.stat -ne 'OK') { Write-Warning 'DUO REST Call Failed' Write-Warning ($APiParams | Out-String) Write-Warning "Method:$method Path:$path" } $Output = $Response | Select-Object -ExpandProperty Response Write-Output $Output } |