mirror of
https://github.com/snazy2000/SnipeitPS.git
synced 2025-12-13 01:42:29 +00:00
Parameter for http request type patch/put
This commit is contained in:
parent
160ba60069
commit
32542fe5fc
2 changed files with 48 additions and 5 deletions
|
|
@ -50,6 +50,12 @@
|
|||
.PARAMETER rtd_location_id
|
||||
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
|
||||
URL of Snipeit system, can be set using Set-SnipeItInfoeItInfo command
|
||||
|
||||
|
|
@ -105,6 +111,11 @@ function Set-SnipeItAsset()
|
|||
|
||||
[int]$rtd_location_id,
|
||||
|
||||
[string]$notes,
|
||||
|
||||
[ValidateSet("Put","Patch")]
|
||||
[string]$RequestType = "Patch",
|
||||
|
||||
[parameter(mandatory = $true)]
|
||||
[string]$url,
|
||||
|
||||
|
|
@ -131,7 +142,7 @@ function Set-SnipeItAsset()
|
|||
|
||||
$Parameters = @{
|
||||
Uri = "$url/api/v1/hardware/$id"
|
||||
Method = 'Put'
|
||||
Method = $RequestType
|
||||
Body = $Body
|
||||
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>]
|
||||
[[-order_number] <String>] [[-warranty_months] <Int32>] [[-purchase_cost] <Double>]
|
||||
[[-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
|
||||
|
|
@ -46,7 +47,7 @@ Parameter Sets: (All)
|
|||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 17
|
||||
Position: 19
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
|
|
@ -107,7 +108,7 @@ Parameter Sets: (All)
|
|||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 18
|
||||
Position: 20
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
|
|
@ -173,6 +174,21 @@ Accept pipeline input: 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 for the asset
|
||||
|
||||
|
|
@ -233,6 +249,22 @@ Accept pipeline input: 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
|
||||
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:
|
||||
|
||||
Required: True
|
||||
Position: 16
|
||||
Position: 18
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue