Convert body only when it exist

This commit is contained in:
Petri Asikainen 2021-06-16 00:52:32 +03:00
parent 2850b82a16
commit d9be192b3e
2 changed files with 6 additions and 4 deletions

View file

@ -35,7 +35,7 @@
} }
#To support images "image" property have be handled before this #To support images "image" property have be handled before this
$Body = $Body | ConvertTo-Json if($Body) { $body = $Body | ConvertTo-Json }
$_headers = @{ $_headers = @{
"Authorization" = "Bearer $($token)" "Authorization" = "Bearer $($token)"
@ -66,7 +66,7 @@
$script:PSDefaultParameterValues = $global:PSDefaultParameterValues $script:PSDefaultParameterValues = $global:PSDefaultParameterValues
Write-Debug $Body Write-Debug "$($Body | ConvertTo-Json)"
# Invoke the API # Invoke the API
try { try {

View file

@ -46,9 +46,11 @@ function Set-SnipeitLicenseSeat()
[int]$seat_id, [int]$seat_id,
[Alias('assigned_id')] [Alias('assigned_id')]
[int]$assigned_to,
[int]$asset_id, [Nullable[System.Int32]]$assigned_to,
[Nullable[System.Int32]]$asset_id,
[string]$note, [string]$note,