From 5761f15eabe8b9750d057540bb88e34b3b6aaa2c Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Mon, 17 May 2021 10:07:17 +0300 Subject: [PATCH] remove whitespace --- SnipeitPS/Public/Get-Accessory.ps1 | 4 ++-- SnipeitPS/Public/Get-Asset.ps1 | 12 ++++++------ SnipeitPS/Public/Get-AssetMaintenance.ps1 | 4 ++-- SnipeitPS/Public/Get-Category.ps1 | 10 +++++----- SnipeitPS/Public/Get-Company.ps1 | 8 ++++---- SnipeitPS/Public/Get-Component.ps1 | 10 +++++----- SnipeitPS/Public/Get-Department.ps1 | 10 +++++----- SnipeitPS/Public/Get-License.ps1 | 10 +++++----- SnipeitPS/Public/Get-Manufacturer.ps1 | 8 ++++---- SnipeitPS/Public/Get-Model.ps1 | 10 +++++----- SnipeitPS/Public/Get-SnipeitLocation.ps1 | 10 +++++----- SnipeitPS/Public/Get-Status.ps1 | 10 +++++----- SnipeitPS/Public/Get-Supplier.ps1 | 10 +++++----- SnipeitPS/Public/New-Category.ps1 | 2 +- SnipeitPS/Public/New-Location.ps1 | 18 +++++++++--------- SnipeitPS/Public/New-User.ps1 | 10 +++++----- SnipeitPS/Public/Set-Components.ps1 | 2 +- SnipeitPS/Public/Set-SnipeitLocation.ps1 | 4 ++-- 18 files changed, 76 insertions(+), 76 deletions(-) diff --git a/SnipeitPS/Public/Get-Accessory.ps1 b/SnipeitPS/Public/Get-Accessory.ps1 index 1f9a639..a40d23f 100644 --- a/SnipeitPS/Public/Get-Accessory.ps1 +++ b/SnipeitPS/Public/Get-Accessory.ps1 @@ -76,8 +76,8 @@ function Get-Accessory() { while ($true) { $callargs['offset'] = $offstart - $callargs['limit'] = $limit - $res=Get-Accessory @callargs + $callargs['limit'] = $limit + $res=Get-Accessory @callargs $res if ($res.count -lt $limit) { break diff --git a/SnipeitPS/Public/Get-Asset.ps1 b/SnipeitPS/Public/Get-Asset.ps1 index f6dc4d2..7d996dd 100644 --- a/SnipeitPS/Public/Get-Asset.ps1 +++ b/SnipeitPS/Public/Get-Asset.ps1 @@ -131,21 +131,21 @@ function Get-Asset() { if ( $search -or $asset_serial -or $asset_tag) { Throw "[$($MyInvocation.MyCommand.Name)] Please specify only one of -search , -asset_tag or -asset_serial parameter" } - $apiurl= "$url/api/v1/hardware/$id" + $apiurl= "$url/api/v1/hardware/$id" } if ($asset_tag) { if ( $search -or $asset_serial -or $id) { Throw "[$($MyInvocation.MyCommand.Name)] Please specify only one of -search , -asset_tag or -asset_serial parameter" } - $apiurl= "$url/api/v1/hardware/bytag/$asset_tag" + $apiurl= "$url/api/v1/hardware/bytag/$asset_tag" } if ($asset_serial) { if ( $search -or $asset_tag) { Throw "[$($MyInvocation.MyCommand.Name)] Please specify only one of-search , -asset_tag or -asset_serial parameter" } - $apiurl= "$url/api/v1/hardware/byserial/$asset_serial" + $apiurl= "$url/api/v1/hardware/byserial/$asset_serial" } $Parameters = @{ @@ -162,8 +162,8 @@ function Get-Asset() { while ($true) { $callargs['offset'] = $offstart - $callargs['limit'] = $limit - $res=Get-Asset @callargs + $callargs['limit'] = $limit + $res=Get-Asset @callargs $res if ( $res.count -lt $limit) { break @@ -175,7 +175,7 @@ function Get-Asset() { $result } - + } diff --git a/SnipeitPS/Public/Get-AssetMaintenance.ps1 b/SnipeitPS/Public/Get-AssetMaintenance.ps1 index 1cb2108..f470da5 100644 --- a/SnipeitPS/Public/Get-AssetMaintenance.ps1 +++ b/SnipeitPS/Public/Get-AssetMaintenance.ps1 @@ -78,8 +78,8 @@ function Get-AssetMaintenance() { while ($true) { $callargs['offset'] = $offstart - $callargs['limit'] = $limit - $res=Get-AssetMaintenance @callargs + $callargs['limit'] = $limit + $res=Get-AssetMaintenance @callargs $res if ($res.count -lt $limit) { break diff --git a/SnipeitPS/Public/Get-Category.ps1 b/SnipeitPS/Public/Get-Category.ps1 index bee35c8..39959be 100644 --- a/SnipeitPS/Public/Get-Category.ps1 +++ b/SnipeitPS/Public/Get-Category.ps1 @@ -55,15 +55,15 @@ function Get-Category() ) $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters - + $apiurl = "$url/api/v1/categories" if ($search -and $id ) { Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both " } - + if ($id) { - $apiurl= "$url/api/v1/categories/$id" + $apiurl= "$url/api/v1/categories/$id" } $Parameters = @{ @@ -80,8 +80,8 @@ function Get-Category() while ($true) { $callargs['offset'] = $offstart - $callargs['limit'] = $limit - $res=Get-Category @callargs + $callargs['limit'] = $limit + $res=Get-Category @callargs $res if ($res.count -lt $limit) { break diff --git a/SnipeitPS/Public/Get-Company.ps1 b/SnipeitPS/Public/Get-Company.ps1 index 975dc2a..7fd5798 100644 --- a/SnipeitPS/Public/Get-Company.ps1 +++ b/SnipeitPS/Public/Get-Company.ps1 @@ -61,9 +61,9 @@ function Get-Company() if ($search -and $id ) { Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both " } - + if ($id) { - $apiurl= "$url/api/v1/companies/$id" + $apiurl= "$url/api/v1/companies/$id" } $Parameters = @{ @@ -80,8 +80,8 @@ function Get-Company() while ($true) { $callargs['offset'] = $offstart - $callargs['limit'] = $limit - $res=Get-Company @callargs + $callargs['limit'] = $limit + $res=Get-Company @callargs $res if ($res.count -lt $limit) { break diff --git a/SnipeitPS/Public/Get-Component.ps1 b/SnipeitPS/Public/Get-Component.ps1 index bedac20..71a028e 100644 --- a/SnipeitPS/Public/Get-Component.ps1 +++ b/SnipeitPS/Public/Get-Component.ps1 @@ -34,7 +34,7 @@ Get-Component -url "https://assets.example.com" -token "token..." | Where-Object function Get-Component() { Param( [string]$search, - + [string]$id, [int]$category_id, @@ -69,9 +69,9 @@ function Get-Component() { if ($search -and $id ) { Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both " } - + if ($id) { - $apiurl= "$url/api/v1/components/$id" + $apiurl= "$url/api/v1/components/$id" } $Parameters = @{ @@ -88,8 +88,8 @@ function Get-Component() { while ($true) { $callargs['offset'] = $offstart - $callargs['limit'] = $limit - $res=Get-Component @callargs + $callargs['limit'] = $limit + $res=Get-Component @callargs $res if ($res.count -lt $limit) { break diff --git a/SnipeitPS/Public/Get-Department.ps1 b/SnipeitPS/Public/Get-Department.ps1 index 8c9966c..85f6b13 100644 --- a/SnipeitPS/Public/Get-Department.ps1 +++ b/SnipeitPS/Public/Get-Department.ps1 @@ -58,15 +58,15 @@ function Get-Department() ) $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters - + $apiurl = "$url/api/v1/departments" if ($search -and $id ) { Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both " } - + if ($id) { - $apiurl= "$url/api/v1/departments/$id" + $apiurl= "$url/api/v1/departments/$id" } $Parameters = @{ @@ -83,8 +83,8 @@ function Get-Department() while ($true) { $callargs['offset'] = $offstart - $callargs['limit'] = $limit - $res=Get-Department @callargs + $callargs['limit'] = $limit + $res=Get-Department @callargs $res if ($res.count -lt $limit) { break diff --git a/SnipeitPS/Public/Get-License.ps1 b/SnipeitPS/Public/Get-License.ps1 index 5bb370b..5d207d6 100644 --- a/SnipeitPS/Public/Get-License.ps1 +++ b/SnipeitPS/Public/Get-License.ps1 @@ -80,15 +80,15 @@ function Get-License() { ) $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters - + $apiurl = "$url/api/v1/licenses" if ($search -and $id ) { Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both " } - + if ($id) { - $apiurl= "$url/api/v1/licenses/$id" + $apiurl= "$url/api/v1/licenses/$id" } $Parameters = @{ @@ -105,8 +105,8 @@ function Get-License() { while ($true) { $callargs['offset'] = $offstart - $callargs['limit'] = $limit - $res=Get-License @callargs + $callargs['limit'] = $limit + $res=Get-License @callargs $res if ($res.count -lt $limit) { break diff --git a/SnipeitPS/Public/Get-Manufacturer.ps1 b/SnipeitPS/Public/Get-Manufacturer.ps1 index 8ebdd31..2260148 100644 --- a/SnipeitPS/Public/Get-Manufacturer.ps1 +++ b/SnipeitPS/Public/Get-Manufacturer.ps1 @@ -61,9 +61,9 @@ function Get-Manufacturer() if ($search -and $id ) { Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both " } - + if ($id) { - $apiurl= "$url/api/v1/manufacturers/$id" + $apiurl= "$url/api/v1/manufacturers/$id" } $Parameters = @{ @@ -80,8 +80,8 @@ function Get-Manufacturer() while ($true) { $callargs['offset'] = $offstart - $callargs['limit'] = $limit - $res=Get-Manufacturer @callargs + $callargs['limit'] = $limit + $res=Get-Manufacturer @callargs $res if ($res.count -lt $limit) { break diff --git a/SnipeitPS/Public/Get-Model.ps1 b/SnipeitPS/Public/Get-Model.ps1 index a3e26a0..76d7d37 100644 --- a/SnipeitPS/Public/Get-Model.ps1 +++ b/SnipeitPS/Public/Get-Model.ps1 @@ -55,15 +55,15 @@ function Get-Model() ) $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters - + $apiurl = "$url/api/v1/models" if ($search -and $id ) { Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both " } - + if ($id) { - $apiurl= "$url/api/v1/models/$id" + $apiurl= "$url/api/v1/models/$id" } $Parameters = @{ @@ -80,8 +80,8 @@ function Get-Model() while ($true) { $callargs['offset'] = $offstart - $callargs['limit'] = $limit - $res=Get-Model @callargs + $callargs['limit'] = $limit + $res=Get-Model @callargs $res if ($res.count -ne $limit ) { break diff --git a/SnipeitPS/Public/Get-SnipeitLocation.ps1 b/SnipeitPS/Public/Get-SnipeitLocation.ps1 index a792aa9..3d61c9a 100644 --- a/SnipeitPS/Public/Get-SnipeitLocation.ps1 +++ b/SnipeitPS/Public/Get-SnipeitLocation.ps1 @@ -35,7 +35,7 @@ function Get-SnipeitLocation() { Param( [string]$search, - + [string]$id, [ValidateSet("asc", "desc")] @@ -61,9 +61,9 @@ function Get-SnipeitLocation() if ($search -and $id ) { Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both " } - + if ($id) { - $apiurl= "$url/api/v1/locations/$id" + $apiurl= "$url/api/v1/locations/$id" } $Parameters = @{ @@ -80,8 +80,8 @@ function Get-SnipeitLocation() while ($true) { $callargs['offset'] = $offstart - $callargs['limit'] = $limit - $res=Get-SnipeitLocation @callargs + $callargs['limit'] = $limit + $res=Get-SnipeitLocation @callargs $res if ($res.count -lt $limit) { break diff --git a/SnipeitPS/Public/Get-Status.ps1 b/SnipeitPS/Public/Get-Status.ps1 index ae8fb5c..6a6f477 100644 --- a/SnipeitPS/Public/Get-Status.ps1 +++ b/SnipeitPS/Public/Get-Status.ps1 @@ -55,15 +55,15 @@ function Get-Status() ) $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters - + $apiurl = "$url/api/v1/statuslabels" if ($search -and $id ) { Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both " } - + if ($id) { - $apiurl= "$url/api/v1/statuslabels/$id" + $apiurl= "$url/api/v1/statuslabels/$id" } $Parameters = @{ @@ -80,8 +80,8 @@ function Get-Status() while ($true) { $callargs['offset'] = $offstart - $callargs['limit'] = $limit - $res=Get-Status @callargs + $callargs['limit'] = $limit + $res=Get-Status @callargs $res if ($res.count -lt $limit) { break diff --git a/SnipeitPS/Public/Get-Supplier.ps1 b/SnipeitPS/Public/Get-Supplier.ps1 index 8b167c7..4cbbb98 100644 --- a/SnipeitPS/Public/Get-Supplier.ps1 +++ b/SnipeitPS/Public/Get-Supplier.ps1 @@ -55,15 +55,15 @@ function Get-Supplier() ) $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters - + $apiurl = "$url/api/v1/suppliers" if ($search -and $id ) { Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both " } - + if ($id) { - $apiurl= "$url/api/v1/suppliers/$id" + $apiurl= "$url/api/v1/suppliers/$id" } $Parameters = @{ @@ -80,8 +80,8 @@ function Get-Supplier() while ($true) { $callargs['offset'] = $offstart - $callargs['limit'] = $limit - $res=Get-Supplier @callargs + $callargs['limit'] = $limit + $res=Get-Supplier @callargs $res if ($res.count -lt $limit) { break diff --git a/SnipeitPS/Public/New-Category.ps1 b/SnipeitPS/Public/New-Category.ps1 index c750a14..fc5c0e1 100644 --- a/SnipeitPS/Public/New-Category.ps1 +++ b/SnipeitPS/Public/New-Category.ps1 @@ -63,7 +63,7 @@ function New-Category() if ($checkin_email) { $Values += @{"checkin_email" = $true} } - + $Body = $Values | ConvertTo-Json; $Parameters = @{ diff --git a/SnipeitPS/Public/New-Location.ps1 b/SnipeitPS/Public/New-Location.ps1 index 66e425f..d15cc93 100644 --- a/SnipeitPS/Public/New-Location.ps1 +++ b/SnipeitPS/Public/New-Location.ps1 @@ -7,22 +7,22 @@ .PARAMETER name Name of the Location - + .PARAMETER address Address line 1 of the location - + .PARAMETER address2 Address line 2 of the location - + .PARAMETER state Address State of the location - + .PARAMETER country Country of the location - + .PARAMETER zip The zip code of the location - + .PARAMETER ldap_ou The LDAP OU of the location @@ -31,10 +31,10 @@ .PARAMETER currency Currency used at the location - + .PARAMETER manager_id The manager ID of the location - + .PARAMETER url URL of Snipeit system, can be set using Set-Info command @@ -64,7 +64,7 @@ function New-Location() { [string]$country, [string]$zip, - + [int]$parent_id, [int]$manager_id, diff --git a/SnipeitPS/Public/New-User.ps1 b/SnipeitPS/Public/New-User.ps1 index ec77a10..49d4507 100644 --- a/SnipeitPS/Public/New-User.ps1 +++ b/SnipeitPS/Public/New-User.ps1 @@ -100,20 +100,20 @@ function New-User() { [bool]$ldap_import = $false, - + [parameter(mandatory = $true)] [string]$url, [parameter(mandatory = $true)] [string]$apiKey ) - + $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters - + if ($password ) { - $Values['password_confirmation'] = $password + $Values['password_confirmation'] = $password } - + $Body = $Values | ConvertTo-Json; $Parameters = @{ diff --git a/SnipeitPS/Public/Set-Components.ps1 b/SnipeitPS/Public/Set-Components.ps1 index 92f44f8..b6f95fe 100644 --- a/SnipeitPS/Public/Set-Components.ps1 +++ b/SnipeitPS/Public/Set-Components.ps1 @@ -26,7 +26,7 @@ function Set-Component() $Body = $Values | ConvertTo-Json; $Parameters = @{ - Uri = "$url/api/v1/components/$component_id" + Uri = "$url/api/v1/components/$id" Method = 'Patch' Body = $Body Token = $apiKey diff --git a/SnipeitPS/Public/Set-SnipeitLocation.ps1 b/SnipeitPS/Public/Set-SnipeitLocation.ps1 index 02930ad..e517d07 100644 --- a/SnipeitPS/Public/Set-SnipeitLocation.ps1 +++ b/SnipeitPS/Public/Set-SnipeitLocation.ps1 @@ -44,7 +44,7 @@ .EXAMPLE Set-SnipeitLocation -id 123 -name "Some storage" -parent_id 100 - + #> function Set-SnipeitLocation() { [CmdletBinding( @@ -82,7 +82,7 @@ function Set-SnipeitLocation() { [string]$apiKey ) - $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters + $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Body = $Values | ConvertTo-Json;