mirror of
https://github.com/snazy2000/SnipeitPS.git
synced 2025-12-13 01:42:29 +00:00
remove whitespace
This commit is contained in:
parent
cb66a0112a
commit
5761f15eab
18 changed files with 76 additions and 76 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ function New-Category()
|
|||
if ($checkin_email) {
|
||||
$Values += @{"checkin_email" = $true}
|
||||
}
|
||||
|
||||
|
||||
$Body = $Values | ConvertTo-Json;
|
||||
|
||||
$Parameters = @{
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 = @{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue