SnipeitPS/SnipeitPS/Public/Get-Supplier.ps1
2017-12-31 19:36:51 +00:00

39 lines
766 B
PowerShell

<#
.SYNOPSIS
# Gets a list of Snipe-it Suppliers
.PARAMETER url
URL of Snipeit system, can be set using Set-Info command
.PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command
.EXAMPLE
Get-Supplier -url "https://assets.example.com" -token "token..."
.EXAMPLE
Get-Supplier -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "MySupplier" }
#>
function Get-Supplier()
{
Param(
[parameter(mandatory=$true)]
[string]$url,
[parameter(mandatory=$true)]
[string]$apiKey
)
$Parameters = @{
Uri = "$url/api/v1/suppliers"
Method = 'Get'
Token = $apiKey
}
$result = Invoke-SnipeitMethod @Parameters
$result
}