AllowEmptyString() is only needed on mandatory parameters

This commit is contained in:
Petri Asikainen 2021-06-08 08:08:33 +03:00
parent 9562ab3d46
commit 1e31256487
8 changed files with 11 additions and 20 deletions

View file

@ -84,7 +84,7 @@ function Set-SnipeItAccessory() {
[ValidateRange(1, [int]::MaxValue)]
[int]$manufacturer_id,
[AllowEmptyString()]
[string]$order_number,
[float]$purchase_cost,

View file

@ -86,7 +86,7 @@ function Set-SnipeItAsset()
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id,
[AllowEmptyString()]
[string]$name,
[int]$status_id,
@ -101,7 +101,7 @@ function Set-SnipeItAsset()
[string]$serial,
[AllowEmptyString()]
[string]$order_number,
[int]$warranty_months,

View file

@ -61,7 +61,7 @@ function Set-SnipeItComponent()
[int]$location_id,
[AllowEmptyString()]
[string]$order_number,
[datetime]$purchase_date,

View file

@ -107,7 +107,7 @@ function Set-SnipeItLicense() {
[string]$notes,
[AllowEmptyString()]
[string]$order_number,
[float]$purchase_cost,

View file

@ -68,30 +68,22 @@ function Set-SnipeitLocation() {
[ValidateLength(3, 255)]
[string]$name,
[AllowEmptyString()]
[string]$address,
[AllowEmptyString()]
[string]$address2,
[AllowEmptyString()]
[string]$state,
[AllowEmptyString()]
[string]$country,
[AllowEmptyString()]
[string]$zip,
[AllowEmptyString()]
[string]$city,
[AllowEmptyString()]
[string]$currency,
[int]$manager_id,
[AllowEmptyString()]
[string]$ldap_ou,
[int]$parent_id,

View file

@ -46,7 +46,6 @@ function Set-SnipeItModel() {
[ValidateLength(1, 255)]
[string]$name,
[AllowEmptyString()]
[string]$model_number,
[int]$category_id,

View file

@ -80,13 +80,13 @@ function Set-SnipeItUser() {
[string]$userName,
[AllowEmptyString()]
[string]$jobtitle,
[AllowEmptyString()]
[string]$email,
[AllowEmptyString()]
[string]$phone,
[int]$company_id,
@ -97,12 +97,12 @@ function Set-SnipeItUser() {
[int]$manager_id,
[AllowEmptyString()]
[string]$employee_num,
[bool]$activated,
[AllowEmptyString()]
[string]$notes,
[parameter(mandatory = $true)]

View file

@ -25,7 +25,7 @@ function Update-SnipeItAlias()
param(
[Parameter(Mandatory = $true,
ValueFromPipeline = $true)]
[AllowEmptyString()]
[string[]]
$String
)