SnipeitPS/SnipeitPS/Public/Get-SnipeitAccessoryOwner.ps1

50 lines
1,016 B
PowerShell
Raw Normal View History

<#
.SYNOPSIS
Get list of checked out accessories
.DESCRIPTION
Get list of checked out accessories
.PARAMETER id
Unique ID For accessory to list
.PARAMETER url
2021-06-08 20:23:32 +03:00
URL of Snipeit system, can be set using Set-SnipeitInfo command
.PARAMETER apiKey
2021-06-08 20:23:32 +03:00
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
.EXAMPLE
2021-06-08 20:23:32 +03:00
Get-SnipeitAccessoryOwner -id 1
#>
2021-06-08 20:23:32 +03:00
function Get-SnipeitAccessoryOwner()
{
[CmdletBinding(
SupportsShouldProcess = $true,
ConfirmImpact = "Medium"
)]
Param(
[parameter(mandatory = $true)]
[int]$id,
[parameter(mandatory = $true)]
[string]$url,
[parameter(mandatory = $true)]
[string]$apiKey
)
$Parameters = @{
Uri = "$url/api/v1/accessories/$id/checkedout"
Method = 'GET'
Token = $apiKey
}
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
{
$result = Invoke-SnipeitMethod @Parameters
}
return $result
}