diff --git a/SnipeitPS/Public/New-SnipeitAudit.ps1 b/SnipeitPS/Public/New-SnipeitAudit.ps1 index 671374a..60d4a7e 100644 --- a/SnipeitPS/Public/New-SnipeitAudit.ps1 +++ b/SnipeitPS/Public/New-SnipeitAudit.ps1 @@ -8,6 +8,9 @@ Long description .PARAMETER Tag The asset tag of the asset you wish to audit +.PARAMETER next_audit_date +Due date for the asset's next audit + .PARAMETER Location_id ID of the location you want to associate with the audit @@ -28,6 +31,9 @@ function New-SnipeitAudit() { [int]$location_id, + [parameter(mandatory = $false)] + [datetime]$next_audit_date, + [parameter(mandatory = $false)] [string]$url, @@ -45,6 +51,10 @@ function New-SnipeitAudit() { if ($PSBoundParameters.ContainsKey('tag')) { $Values += @{"asset_tag" = $tag} } + + if ($PSBoundParameters.ContainsKey('next_audit_date')) { + $Values += @{"next_audit_date" = ($next_audit_date).ToString("yyyy-MM-dd")} + } $Parameters = @{ Api = "/api/v1/hardware/audit" diff --git a/docs/New-SnipeitAudit.md b/docs/New-SnipeitAudit.md index 7de61f2..20661cc 100644 --- a/docs/New-SnipeitAudit.md +++ b/docs/New-SnipeitAudit.md @@ -13,8 +13,8 @@ Add a new Audit to Snipe-it asset system ## SYNTAX ``` -New-SnipeitAudit [-tag] [[-location_id] ] [[-url] ] [[-apiKey] ] [-WhatIf] - [-Confirm] [] +New-SnipeitAudit [-tag] [[-location_id] ] [[-next_audit_date] ] [[-url] ] + [[-apiKey] ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -38,7 +38,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 +Position: 5 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -59,6 +59,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -next_audit_date +Due date for the asset's next audit + +```yaml +Type: DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -tag The asset tag of the asset you wish to audit @@ -83,7 +98,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 3 +Position: 4 Default value: None Accept pipeline input: False Accept wildcard characters: False