Merge pull request #95 from PetriAsi/fix/remove-white-space

remove whitespace
This commit is contained in:
Petri Asikainen 2021-05-17 10:09:58 +03:00 committed by GitHub
commit 8fd8082aa3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 76 additions and 76 deletions

View file

@ -76,8 +76,8 @@ function Get-Accessory() {
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-Accessory @callargs $res=Get-Accessory @callargs
$res $res
if ($res.count -lt $limit) { if ($res.count -lt $limit) {
break break

View file

@ -131,21 +131,21 @@ function Get-Asset() {
if ( $search -or $asset_serial -or $asset_tag) { if ( $search -or $asset_serial -or $asset_tag) {
Throw "[$($MyInvocation.MyCommand.Name)] Please specify only one of -search , -asset_tag or -asset_serial parameter" 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 ($asset_tag) {
if ( $search -or $asset_serial -or $id) { if ( $search -or $asset_serial -or $id) {
Throw "[$($MyInvocation.MyCommand.Name)] Please specify only one of -search , -asset_tag or -asset_serial parameter" 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 ($asset_serial) {
if ( $search -or $asset_tag) { if ( $search -or $asset_tag) {
Throw "[$($MyInvocation.MyCommand.Name)] Please specify only one of-search , -asset_tag or -asset_serial parameter" 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 = @{ $Parameters = @{
@ -162,8 +162,8 @@ function Get-Asset() {
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-Asset @callargs $res=Get-Asset @callargs
$res $res
if ( $res.count -lt $limit) { if ( $res.count -lt $limit) {
break break
@ -175,7 +175,7 @@ function Get-Asset() {
$result $result
} }
} }

View file

@ -78,8 +78,8 @@ function Get-AssetMaintenance() {
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-AssetMaintenance @callargs $res=Get-AssetMaintenance @callargs
$res $res
if ($res.count -lt $limit) { if ($res.count -lt $limit) {
break break

View file

@ -55,15 +55,15 @@ function Get-Category()
) )
$SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$apiurl = "$url/api/v1/categories" $apiurl = "$url/api/v1/categories"
if ($search -and $id ) { if ($search -and $id ) {
Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both " Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both "
} }
if ($id) { if ($id) {
$apiurl= "$url/api/v1/categories/$id" $apiurl= "$url/api/v1/categories/$id"
} }
$Parameters = @{ $Parameters = @{
@ -80,8 +80,8 @@ function Get-Category()
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-Category @callargs $res=Get-Category @callargs
$res $res
if ($res.count -lt $limit) { if ($res.count -lt $limit) {
break break

View file

@ -61,9 +61,9 @@ function Get-Company()
if ($search -and $id ) { if ($search -and $id ) {
Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both " Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both "
} }
if ($id) { if ($id) {
$apiurl= "$url/api/v1/companies/$id" $apiurl= "$url/api/v1/companies/$id"
} }
$Parameters = @{ $Parameters = @{
@ -80,8 +80,8 @@ function Get-Company()
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-Company @callargs $res=Get-Company @callargs
$res $res
if ($res.count -lt $limit) { if ($res.count -lt $limit) {
break break

View file

@ -34,7 +34,7 @@ Get-Component -url "https://assets.example.com" -token "token..." | Where-Object
function Get-Component() { function Get-Component() {
Param( Param(
[string]$search, [string]$search,
[string]$id, [string]$id,
[int]$category_id, [int]$category_id,
@ -69,9 +69,9 @@ function Get-Component() {
if ($search -and $id ) { if ($search -and $id ) {
Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both " Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both "
} }
if ($id) { if ($id) {
$apiurl= "$url/api/v1/components/$id" $apiurl= "$url/api/v1/components/$id"
} }
$Parameters = @{ $Parameters = @{
@ -88,8 +88,8 @@ function Get-Component() {
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-Component @callargs $res=Get-Component @callargs
$res $res
if ($res.count -lt $limit) { if ($res.count -lt $limit) {
break break

View file

@ -58,15 +58,15 @@ function Get-Department()
) )
$SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$apiurl = "$url/api/v1/departments" $apiurl = "$url/api/v1/departments"
if ($search -and $id ) { if ($search -and $id ) {
Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both " Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both "
} }
if ($id) { if ($id) {
$apiurl= "$url/api/v1/departments/$id" $apiurl= "$url/api/v1/departments/$id"
} }
$Parameters = @{ $Parameters = @{
@ -83,8 +83,8 @@ function Get-Department()
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-Department @callargs $res=Get-Department @callargs
$res $res
if ($res.count -lt $limit) { if ($res.count -lt $limit) {
break break

View file

@ -80,15 +80,15 @@ function Get-License() {
) )
$SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$apiurl = "$url/api/v1/licenses" $apiurl = "$url/api/v1/licenses"
if ($search -and $id ) { if ($search -and $id ) {
Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both " Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both "
} }
if ($id) { if ($id) {
$apiurl= "$url/api/v1/licenses/$id" $apiurl= "$url/api/v1/licenses/$id"
} }
$Parameters = @{ $Parameters = @{
@ -105,8 +105,8 @@ function Get-License() {
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-License @callargs $res=Get-License @callargs
$res $res
if ($res.count -lt $limit) { if ($res.count -lt $limit) {
break break

View file

@ -61,9 +61,9 @@ function Get-Manufacturer()
if ($search -and $id ) { if ($search -and $id ) {
Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both " Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both "
} }
if ($id) { if ($id) {
$apiurl= "$url/api/v1/manufacturers/$id" $apiurl= "$url/api/v1/manufacturers/$id"
} }
$Parameters = @{ $Parameters = @{
@ -80,8 +80,8 @@ function Get-Manufacturer()
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-Manufacturer @callargs $res=Get-Manufacturer @callargs
$res $res
if ($res.count -lt $limit) { if ($res.count -lt $limit) {
break break

View file

@ -55,15 +55,15 @@ function Get-Model()
) )
$SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$apiurl = "$url/api/v1/models" $apiurl = "$url/api/v1/models"
if ($search -and $id ) { if ($search -and $id ) {
Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both " Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both "
} }
if ($id) { if ($id) {
$apiurl= "$url/api/v1/models/$id" $apiurl= "$url/api/v1/models/$id"
} }
$Parameters = @{ $Parameters = @{
@ -80,8 +80,8 @@ function Get-Model()
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-Model @callargs $res=Get-Model @callargs
$res $res
if ($res.count -ne $limit ) { if ($res.count -ne $limit ) {
break break

View file

@ -35,7 +35,7 @@ function Get-SnipeitLocation()
{ {
Param( Param(
[string]$search, [string]$search,
[string]$id, [string]$id,
[ValidateSet("asc", "desc")] [ValidateSet("asc", "desc")]
@ -61,9 +61,9 @@ function Get-SnipeitLocation()
if ($search -and $id ) { if ($search -and $id ) {
Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both " Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both "
} }
if ($id) { if ($id) {
$apiurl= "$url/api/v1/locations/$id" $apiurl= "$url/api/v1/locations/$id"
} }
$Parameters = @{ $Parameters = @{
@ -80,8 +80,8 @@ function Get-SnipeitLocation()
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-SnipeitLocation @callargs $res=Get-SnipeitLocation @callargs
$res $res
if ($res.count -lt $limit) { if ($res.count -lt $limit) {
break break

View file

@ -55,15 +55,15 @@ function Get-Status()
) )
$SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$apiurl = "$url/api/v1/statuslabels" $apiurl = "$url/api/v1/statuslabels"
if ($search -and $id ) { if ($search -and $id ) {
Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both " Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both "
} }
if ($id) { if ($id) {
$apiurl= "$url/api/v1/statuslabels/$id" $apiurl= "$url/api/v1/statuslabels/$id"
} }
$Parameters = @{ $Parameters = @{
@ -80,8 +80,8 @@ function Get-Status()
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-Status @callargs $res=Get-Status @callargs
$res $res
if ($res.count -lt $limit) { if ($res.count -lt $limit) {
break break

View file

@ -55,15 +55,15 @@ function Get-Supplier()
) )
$SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$apiurl = "$url/api/v1/suppliers" $apiurl = "$url/api/v1/suppliers"
if ($search -and $id ) { if ($search -and $id ) {
Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both " Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both "
} }
if ($id) { if ($id) {
$apiurl= "$url/api/v1/suppliers/$id" $apiurl= "$url/api/v1/suppliers/$id"
} }
$Parameters = @{ $Parameters = @{
@ -80,8 +80,8 @@ function Get-Supplier()
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-Supplier @callargs $res=Get-Supplier @callargs
$res $res
if ($res.count -lt $limit) { if ($res.count -lt $limit) {
break break

View file

@ -63,7 +63,7 @@ function New-Category()
if ($checkin_email) { if ($checkin_email) {
$Values += @{"checkin_email" = $true} $Values += @{"checkin_email" = $true}
} }
$Body = $Values | ConvertTo-Json; $Body = $Values | ConvertTo-Json;
$Parameters = @{ $Parameters = @{

View file

@ -7,22 +7,22 @@
.PARAMETER name .PARAMETER name
Name of the Location Name of the Location
.PARAMETER address .PARAMETER address
Address line 1 of the location Address line 1 of the location
.PARAMETER address2 .PARAMETER address2
Address line 2 of the location Address line 2 of the location
.PARAMETER state .PARAMETER state
Address State of the location Address State of the location
.PARAMETER country .PARAMETER country
Country of the location Country of the location
.PARAMETER zip .PARAMETER zip
The zip code of the location The zip code of the location
.PARAMETER ldap_ou .PARAMETER ldap_ou
The LDAP OU of the location The LDAP OU of the location
@ -31,10 +31,10 @@
.PARAMETER currency .PARAMETER currency
Currency used at the location Currency used at the location
.PARAMETER manager_id .PARAMETER manager_id
The manager ID of the location The manager ID of the location
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-Info command
@ -64,7 +64,7 @@ function New-Location() {
[string]$country, [string]$country,
[string]$zip, [string]$zip,
[int]$parent_id, [int]$parent_id,
[int]$manager_id, [int]$manager_id,

View file

@ -100,20 +100,20 @@ function New-User() {
[bool]$ldap_import = $false, [bool]$ldap_import = $false,
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$apiKey [string]$apiKey
) )
$Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
if ($password ) { if ($password ) {
$Values['password_confirmation'] = $password $Values['password_confirmation'] = $password
} }
$Body = $Values | ConvertTo-Json; $Body = $Values | ConvertTo-Json;
$Parameters = @{ $Parameters = @{

View file

@ -26,7 +26,7 @@ function Set-Component()
$Body = $Values | ConvertTo-Json; $Body = $Values | ConvertTo-Json;
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/components/$component_id" Uri = "$url/api/v1/components/$id"
Method = 'Patch' Method = 'Patch'
Body = $Body Body = $Body
Token = $apiKey Token = $apiKey

View file

@ -44,7 +44,7 @@
.EXAMPLE .EXAMPLE
Set-SnipeitLocation -id 123 -name "Some storage" -parent_id 100 Set-SnipeitLocation -id 123 -name "Some storage" -parent_id 100
#> #>
function Set-SnipeitLocation() { function Set-SnipeitLocation() {
[CmdletBinding( [CmdletBinding(
@ -82,7 +82,7 @@ function Set-SnipeitLocation() {
[string]$apiKey [string]$apiKey
) )
$Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$Body = $Values | ConvertTo-Json; $Body = $Values | ConvertTo-Json;