mirror of
https://github.com/snazy2000/SnipeitPS.git
synced 2025-12-13 18:02:30 +00:00
Changed to hash table, fixed optional switches formatting
This commit is contained in:
parent
95eed3330c
commit
b3826d33ec
1 changed files with 10 additions and 6 deletions
|
|
@ -47,20 +47,24 @@ function New-Category()
|
|||
[switch]$checkin_email
|
||||
)
|
||||
|
||||
$Values = . Get-ParameterValue
|
||||
|
||||
# $Values = . Get-ParameterValue
|
||||
$Values = @{
|
||||
"name" = $name
|
||||
"category_type" = $category_type
|
||||
}
|
||||
|
||||
if ($use_default_eula) {
|
||||
$Values += @{"use_default_eula" = "true"}
|
||||
$Values += @{"use_default_eula" = $true}
|
||||
}
|
||||
|
||||
if ($require_acceptance) {
|
||||
$Values += @{"require_acceptance" = "true"}
|
||||
$Values += @{"require_acceptance" = $true}
|
||||
}
|
||||
|
||||
if ($checkin_email) {
|
||||
$Values += @{"checkin_email" = "true"}
|
||||
$Values += @{"checkin_email" = $true}
|
||||
}
|
||||
|
||||
|
||||
$Body = $Values | ConvertTo-Json;
|
||||
|
||||
$Parameters = @{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue