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:
Petri Asikainen 2021-05-25 15:49:39 +03:00 committed by GitHub
commit 09d16fe5a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 48 additions and 5 deletions

View file

@ -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
}

View file

@ -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