mirror of
https://github.com/snazy2000/SnipeitPS.git
synced 2025-12-13 18:02:30 +00:00
41 lines
771 B
PowerShell
41 lines
771 B
PowerShell
function Set-AssetOwner()
|
|
{
|
|
[CmdletBinding(
|
|
SupportsShouldProcess = $true,
|
|
ConfirmImpact = "High"
|
|
)]
|
|
|
|
Param(
|
|
[parameter(mandatory = $true)]
|
|
[int]$id,
|
|
|
|
[parameter(mandatory = $true)]
|
|
[int]$user_id,
|
|
|
|
[parameter(mandatory = $true)]
|
|
[string]$url,
|
|
|
|
[parameter(mandatory = $true)]
|
|
[string]$apiKey
|
|
)
|
|
|
|
$Values = @{
|
|
"user_id" = $user_id
|
|
}
|
|
|
|
$Body = $Values | ConvertTo-Json;
|
|
|
|
$Parameters = @{
|
|
Uri = "$url/api/v1/hardware/$id/checkout"
|
|
Method = 'POST'
|
|
Body = $Body
|
|
Token = $apiKey
|
|
}
|
|
|
|
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
|
|
{
|
|
$result = Invoke-SnipeitMethod @Parameters
|
|
}
|
|
|
|
return $result
|
|
}
|