mirror of
https://github.com/snazy2000/SnipeitPS.git
synced 2025-12-15 18:55:47 +00:00
Don't asume that name, model, and status is always given
This commit is contained in:
parent
f182756b30
commit
65af96728a
1 changed files with 13 additions and 4 deletions
|
|
@ -59,12 +59,21 @@ function Set-Asset()
|
|||
[hashtable] $customfields
|
||||
)
|
||||
|
||||
$Values = @{
|
||||
"name" = $Name
|
||||
"status_id" = $status_id
|
||||
"model_id" = $model_id
|
||||
$Values = @{}
|
||||
|
||||
if ($Name) {
|
||||
$Values.Add('Name',$Name)
|
||||
}
|
||||
|
||||
if ($Status_id) {
|
||||
$Values.Add('status_id',$Status_id)
|
||||
}
|
||||
|
||||
if ($Model_id) {
|
||||
$Values.Add('model_id',$model_id)
|
||||
}
|
||||
|
||||
|
||||
if ($customfields)
|
||||
{
|
||||
$Values += $customfields
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue