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
$apiuri = "$url/api/v1/hardware"
$apiurl = "$url/api/v1/hardware"
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"
@ -127,25 +127,25 @@ 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"
}
$apiuri= "$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"
}
$apiuri= "$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"
}
$apiuri= "$url/api/v1/hardware/byserial/$asset_serial"
$apiurl= "$url/api/v1/hardware/byserial/$asset_serial"
}
$Parameters = @{
Uri = "$apiuri"
Uri = $apiurl
Method = 'Get'
GetParameters = $SearchParameter
Token = $apiKey

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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