From 32542fe5fccf74445ca552bd4089fb3dfd16d454 Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Tue, 25 May 2021 15:44:14 +0300 Subject: [PATCH] Parameter for http request type patch/put --- SnipeitPS/Public/Set-SnipeItAsset.ps1 | 13 ++++++++- docs/Set-SnipeItAsset.md | 40 ++++++++++++++++++++++++--- 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/SnipeitPS/Public/Set-SnipeItAsset.ps1 b/SnipeitPS/Public/Set-SnipeItAsset.ps1 index 722086d..d8fa71e 100644 --- a/SnipeitPS/Public/Set-SnipeItAsset.ps1 +++ b/SnipeitPS/Public/Set-SnipeItAsset.ps1 @@ -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 } diff --git a/docs/Set-SnipeItAsset.md b/docs/Set-SnipeItAsset.md index 626bcf2..51df0a1 100644 --- a/docs/Set-SnipeItAsset.md +++ b/docs/Set-SnipeItAsset.md @@ -17,7 +17,8 @@ Set-SnipeItAsset [-id] [[-Name] ] [[-status_id] ] [[-mode [[-last_checkout] ] [[-assigned_to] ] [[-company_id] ] [[-serial] ] [[-order_number] ] [[-warranty_months] ] [[-purchase_cost] ] [[-purchase_date] ] [[-requestable] ] [[-archived] ] [[-rtd_location_id] ] - [-url] [-apiKey] [[-customfields] ] [-WhatIf] [-Confirm] [] + [[-notes] ] [[-RequestType] ] [-url] [-apiKey] [[-customfields] ] + [-WhatIf] [-Confirm] [] ``` ## 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