Public/New-Company.ps1
<# .SYNOPSIS Short description .DESCRIPTION Long description .PARAMETER name Parameter description .PARAMETER url Parameter description .PARAMETER apiKey Parameter description .EXAMPLE An example .NOTES General notes #> function New-Company() { [CmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = "Low" )] Param( [parameter(mandatory = $true)] [string]$name, [parameter(mandatory = $true)] [string]$url, [parameter(mandatory = $true)] [string]$apiKey ) $Values = @{ "name" = $name } $Body = $Values | ConvertTo-Json; $Parameters = @{ Uri = "$url/api/v1/companies" Method = 'POST' Body = $Body Token = $apiKey } If ($PSCmdlet.ShouldProcess("ShouldProcess?")) { $result = Invoke-SnipeitMethod @Parameters } $result } |