mirror of
https://github.com/snazy2000/SnipeitPS.git
synced 2025-12-13 18:02:30 +00:00
Get-asset with -asset_tag
This commit is contained in:
parent
f182756b30
commit
c88dd83323
1 changed files with 12 additions and 1 deletions
|
|
@ -60,6 +60,8 @@ function Get-Asset() {
|
||||||
Param(
|
Param(
|
||||||
[string]$search,
|
[string]$search,
|
||||||
|
|
||||||
|
[string]$asset_tag,
|
||||||
|
|
||||||
[int]$order_number,
|
[int]$order_number,
|
||||||
|
|
||||||
[int]$model_id,
|
[int]$model_id,
|
||||||
|
|
@ -98,8 +100,17 @@ function Get-Asset() {
|
||||||
|
|
||||||
$SearchParameter = . Get-ParameterValue
|
$SearchParameter = . Get-ParameterValue
|
||||||
|
|
||||||
|
$apiuri = "$url/api/v1/hardware"
|
||||||
|
|
||||||
|
if ($asset_tag) {
|
||||||
|
if ( $search) {
|
||||||
|
Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -asset_tag parameter , not both "
|
||||||
|
}
|
||||||
|
$apiuri= "$url/api/v1/hardware/bytag/$asset_tag"
|
||||||
|
}
|
||||||
|
|
||||||
$Parameters = @{
|
$Parameters = @{
|
||||||
Uri = "$url/api/v1/hardware"
|
Uri = "$apiuri"
|
||||||
Method = 'Get'
|
Method = 'Get'
|
||||||
GetParameters = $SearchParameter
|
GetParameters = $SearchParameter
|
||||||
Token = $apiKey
|
Token = $apiKey
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue