2021-05-25 22:53:22 +03:00
|
|
|
<#
|
|
|
|
|
.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
|
2021-05-25 22:53:22 +03:00
|
|
|
|
|
|
|
|
.PARAMETER apiKey
|
2021-06-08 20:23:32 +03:00
|
|
|
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
|
2021-05-25 22:53:22 +03:00
|
|
|
|
|
|
|
|
.EXAMPLE
|
2021-06-08 20:23:32 +03:00
|
|
|
Get-SnipeitAccessoryOwner -id 1
|
2021-05-25 22:53:22 +03:00
|
|
|
#>
|
2021-06-08 20:23:32 +03:00
|
|
|
function Get-SnipeitAccessoryOwner()
|
2021-05-25 22:53:22 +03:00
|
|
|
{
|
|
|
|
|
[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
|
|
|
|
|
}
|