mirror of
https://github.com/snazy2000/SnipeitPS.git
synced 2025-12-13 09:52: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(
|
||||
[string]$search,
|
||||
|
||||
[string]$asset_tag,
|
||||
|
||||
[int]$order_number,
|
||||
|
||||
[int]$model_id,
|
||||
|
|
@ -98,8 +100,17 @@ function Get-Asset() {
|
|||
|
||||
$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 = @{
|
||||
Uri = "$url/api/v1/hardware"
|
||||
Uri = "$apiuri"
|
||||
Method = 'Get'
|
||||
GetParameters = $SearchParameter
|
||||
Token = $apiKey
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue