Fixed copypasted typo

This commit is contained in:
Petri Asikainen 2021-01-17 07:11:22 +02:00
parent 953a3453fc
commit 608d8f04ca
12 changed files with 19 additions and 19 deletions

View file

@ -117,7 +117,7 @@ function Get-Asset() {
$SearchParameter = . Get-ParameterValue $SearchParameter = . Get-ParameterValue
$apiuri = "$url/api/v1/hardware" $apiurl = "$url/api/v1/hardware"
if ($search -and ($asset_tag -or $asset_serial -or $id)) { if ($search -and ($asset_tag -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"
@ -127,25 +127,25 @@ 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"
} }
$apiuri= "$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"
} }
$apiuri= "$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"
} }
$apiuri= "$url/api/v1/hardware/byserial/$asset_serial" $apiurl= "$url/api/v1/hardware/byserial/$asset_serial"
} }
$Parameters = @{ $Parameters = @{
Uri = "$apiuri" Uri = $apiurl
Method = 'Get' Method = 'Get'
GetParameters = $SearchParameter GetParameters = $SearchParameter
Token = $apiKey Token = $apiKey

View file

@ -52,7 +52,7 @@ function Get-Category()
} }
if ($id) { if ($id) {
$apiuri= "$url/api/v1/categories/$id" $apiurl= "$url/api/v1/categories/$id"
} }
$Parameters = @{ $Parameters = @{

View file

@ -52,7 +52,7 @@ function Get-Company()
} }
if ($id) { if ($id) {
$apiuri= "$url/api/v1/companies/$id" $apiurl= "$url/api/v1/companies/$id"
} }
$Parameters = @{ $Parameters = @{

View file

@ -60,7 +60,7 @@ function Get-Component() {
} }
if ($id) { if ($id) {
$apiuri= "$url/api/v1/components/$id" $apiurl= "$url/api/v1/components/$id"
} }
$Parameters = @{ $Parameters = @{

View file

@ -55,7 +55,7 @@ function Get-Department()
} }
if ($id) { if ($id) {
$apiuri= "$url/api/v1/departments/$id" $apiurl= "$url/api/v1/departments/$id"
} }
$Parameters = @{ $Parameters = @{

View file

@ -76,7 +76,7 @@ function Get-License() {
} }
if ($id) { if ($id) {
$apiuri= "$url/api/v1/licenses/$id" $apiurl= "$url/api/v1/licenses/$id"
} }
$Parameters = @{ $Parameters = @{

View file

@ -52,7 +52,7 @@ function Get-Manufacturer()
} }
if ($id) { if ($id) {
$apiuri= "$url/api/v1/manufacturers/$id" $apiurl= "$url/api/v1/manufacturers/$id"
} }
$Parameters = @{ $Parameters = @{

View file

@ -27,7 +27,7 @@ function Get-Model()
Param( Param(
[string]$search, [string]$search,
[string]$id, [int]$id,
[ValidateSet("asc", "desc")] [ValidateSet("asc", "desc")]
[string]$order = "desc", [string]$order = "desc",
@ -52,14 +52,14 @@ function Get-Model()
} }
if ($id) { if ($id) {
$apiuri= "$url/api/v1/models/$id" $apiurl= "$url/api/v1/models/id/$id"
} }
write-host "ID $id, -- $SearchParameter"
$Parameters = @{ $Parameters = @{
Uri = $apiurl Uri = $apiurl
Method = 'Get' Method = 'Get'
Token = $apiKey Token = $apiKey
GetParameters = $SearchParameter #GetParameters = $SearchParameter
} }
$result = Invoke-SnipeitMethod @Parameters $result = Invoke-SnipeitMethod @Parameters

View file

@ -52,7 +52,7 @@ function Get-SnipeitLocation()
} }
if ($id) { if ($id) {
$apiuri= "$url/api/v1/locations/$id" $apiurl= "$url/api/v1/locations/$id"
} }
$Parameters = @{ $Parameters = @{

View file

@ -52,7 +52,7 @@ function Get-Status()
} }
if ($id) { if ($id) {
$apiuri= "$url/api/v1/statuslabels/$id" $apiurl= "$url/api/v1/statuslabels/$id"
} }
$Parameters = @{ $Parameters = @{

View file

@ -52,7 +52,7 @@ function Get-Supplier()
} }
if ($id) { if ($id) {
$apiuri= "$url/api/v1/suppliers/$id" $apiurl= "$url/api/v1/suppliers/$id"
} }
$Parameters = @{ $Parameters = @{

View file

@ -58,7 +58,7 @@ function Get-User() {
} }
if ($id) { if ($id) {
$apiuri= "$url/api/v1/users/$id" $apiurl= "$url/api/v1/users/$id"
} }
$Parameters = @{ $Parameters = @{
Uri = $apiurl Uri = $apiurl