mirror of
https://github.com/snazy2000/SnipeitPS.git
synced 2025-12-13 18:02:30 +00:00
Fixed copypasted typo
This commit is contained in:
parent
953a3453fc
commit
608d8f04ca
12 changed files with 19 additions and 19 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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 = @{
|
||||||
|
|
|
||||||
|
|
@ -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 = @{
|
||||||
|
|
|
||||||
|
|
@ -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 = @{
|
||||||
|
|
|
||||||
|
|
@ -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 = @{
|
||||||
|
|
|
||||||
|
|
@ -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 = @{
|
||||||
|
|
|
||||||
|
|
@ -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 = @{
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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 = @{
|
||||||
|
|
|
||||||
|
|
@ -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 = @{
|
||||||
|
|
|
||||||
|
|
@ -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 = @{
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue