mirror of
https://github.com/snazy2000/SnipeitPS.git
synced 2025-12-13 18:02:30 +00:00
Merge pull request #122 from PetriAsi/fix/set-snipeitasset-put-patch
set-snipeitAsset parameter for selecting http request type to patch or put
This commit is contained in:
commit
09d16fe5a5
2 changed files with 48 additions and 5 deletions
|
|
@ -50,6 +50,12 @@
|
||||||
.PARAMETER rtd_location_id
|
.PARAMETER rtd_location_id
|
||||||
The id that corresponds to the location where the asset is usually located when not checked out
|
The id that corresponds to the location where the asset is usually located when not checked out
|
||||||
|
|
||||||
|
.PARAMETER notes
|
||||||
|
Notes about asset
|
||||||
|
|
||||||
|
.PARAMETER RequestType
|
||||||
|
Http request type to send Snipe IT system. Defaults to Put youc use Patch if needed
|
||||||
|
|
||||||
.PARAMETER url
|
.PARAMETER url
|
||||||
URL of Snipeit system, can be set using Set-SnipeItInfoeItInfo command
|
URL of Snipeit system, can be set using Set-SnipeItInfoeItInfo command
|
||||||
|
|
||||||
|
|
@ -105,6 +111,11 @@ function Set-SnipeItAsset()
|
||||||
|
|
||||||
[int]$rtd_location_id,
|
[int]$rtd_location_id,
|
||||||
|
|
||||||
|
[string]$notes,
|
||||||
|
|
||||||
|
[ValidateSet("Put","Patch")]
|
||||||
|
[string]$RequestType = "Patch",
|
||||||
|
|
||||||
[parameter(mandatory = $true)]
|
[parameter(mandatory = $true)]
|
||||||
[string]$url,
|
[string]$url,
|
||||||
|
|
||||||
|
|
@ -131,7 +142,7 @@ function Set-SnipeItAsset()
|
||||||
|
|
||||||
$Parameters = @{
|
$Parameters = @{
|
||||||
Uri = "$url/api/v1/hardware/$id"
|
Uri = "$url/api/v1/hardware/$id"
|
||||||
Method = 'Put'
|
Method = $RequestType
|
||||||
Body = $Body
|
Body = $Body
|
||||||
Token = $apiKey
|
Token = $apiKey
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,8 @@ Set-SnipeItAsset [-id] <Int32> [[-Name] <String>] [[-status_id] <Int32>] [[-mode
|
||||||
[[-last_checkout] <DateTime>] [[-assigned_to] <Int32>] [[-company_id] <Int32>] [[-serial] <String>]
|
[[-last_checkout] <DateTime>] [[-assigned_to] <Int32>] [[-company_id] <Int32>] [[-serial] <String>]
|
||||||
[[-order_number] <String>] [[-warranty_months] <Int32>] [[-purchase_cost] <Double>]
|
[[-order_number] <String>] [[-warranty_months] <Int32>] [[-purchase_cost] <Double>]
|
||||||
[[-purchase_date] <DateTime>] [[-requestable] <Boolean>] [[-archived] <Boolean>] [[-rtd_location_id] <Int32>]
|
[[-purchase_date] <DateTime>] [[-requestable] <Boolean>] [[-archived] <Boolean>] [[-rtd_location_id] <Int32>]
|
||||||
[-url] <String> [-apiKey] <String> [[-customfields] <Hashtable>] [-WhatIf] [-Confirm] [<CommonParameters>]
|
[[-notes] <String>] [[-RequestType] <String>] [-url] <String> [-apiKey] <String> [[-customfields] <Hashtable>]
|
||||||
|
[-WhatIf] [-Confirm] [<CommonParameters>]
|
||||||
```
|
```
|
||||||
|
|
||||||
## DESCRIPTION
|
## DESCRIPTION
|
||||||
|
|
@ -46,7 +47,7 @@ Parameter Sets: (All)
|
||||||
Aliases:
|
Aliases:
|
||||||
|
|
||||||
Required: True
|
Required: True
|
||||||
Position: 17
|
Position: 19
|
||||||
Default value: None
|
Default value: None
|
||||||
Accept pipeline input: False
|
Accept pipeline input: False
|
||||||
Accept wildcard characters: False
|
Accept wildcard characters: False
|
||||||
|
|
@ -107,7 +108,7 @@ Parameter Sets: (All)
|
||||||
Aliases:
|
Aliases:
|
||||||
|
|
||||||
Required: False
|
Required: False
|
||||||
Position: 18
|
Position: 20
|
||||||
Default value: None
|
Default value: None
|
||||||
Accept pipeline input: False
|
Accept pipeline input: False
|
||||||
Accept wildcard characters: False
|
Accept wildcard characters: False
|
||||||
|
|
@ -173,6 +174,21 @@ Accept pipeline input: False
|
||||||
Accept wildcard characters: False
|
Accept wildcard characters: False
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### -notes
|
||||||
|
Notes about asset
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
Type: String
|
||||||
|
Parameter Sets: (All)
|
||||||
|
Aliases:
|
||||||
|
|
||||||
|
Required: False
|
||||||
|
Position: 16
|
||||||
|
Default value: None
|
||||||
|
Accept pipeline input: False
|
||||||
|
Accept wildcard characters: False
|
||||||
|
```
|
||||||
|
|
||||||
### -order_number
|
### -order_number
|
||||||
Order number for the asset
|
Order number for the asset
|
||||||
|
|
||||||
|
|
@ -233,6 +249,22 @@ Accept pipeline input: False
|
||||||
Accept wildcard characters: False
|
Accept wildcard characters: False
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### -RequestType
|
||||||
|
Http request type to send Snipe IT system.
|
||||||
|
Defaults to Put youc use Patch if needed
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
Type: String
|
||||||
|
Parameter Sets: (All)
|
||||||
|
Aliases:
|
||||||
|
|
||||||
|
Required: False
|
||||||
|
Position: 17
|
||||||
|
Default value: Patch
|
||||||
|
Accept pipeline input: False
|
||||||
|
Accept wildcard characters: False
|
||||||
|
```
|
||||||
|
|
||||||
### -rtd_location_id
|
### -rtd_location_id
|
||||||
The id that corresponds to the location where the asset is usually located when not checked out
|
The id that corresponds to the location where the asset is usually located when not checked out
|
||||||
|
|
||||||
|
|
@ -287,7 +319,7 @@ Parameter Sets: (All)
|
||||||
Aliases:
|
Aliases:
|
||||||
|
|
||||||
Required: True
|
Required: True
|
||||||
Position: 16
|
Position: 18
|
||||||
Default value: None
|
Default value: None
|
||||||
Accept pipeline input: False
|
Accept pipeline input: False
|
||||||
Accept wildcard characters: False
|
Accept wildcard characters: False
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue