From 51cb9f88f5f9db2243afdcc376d511943bea4af4 Mon Sep 17 00:00:00 2001 From: RussellLeVasseur <58618324+RussellLeVasseur@users.noreply.github.com> Date: Thu, 27 Jan 2022 09:45:15 -0500 Subject: [PATCH] Update New-SnipeitAudit.ps1 - Modified nextAudit param to [datetime] - Added parameter description at beginning of doc - Added code to format date to yyyy-MM-dd for SnipeIT --- SnipeitPS/Public/New-SnipeitAudit.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SnipeitPS/Public/New-SnipeitAudit.ps1 b/SnipeitPS/Public/New-SnipeitAudit.ps1 index 5996945..cbe4117 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 purchase_date +Due date for the asset's next audit + .PARAMETER Location_id ID of the location you want to associate with the audit @@ -29,7 +32,7 @@ function New-SnipeitAudit() { [int]$location_id, [parameter(mandatory = $false)] - [string]$nextAudit, + [datetime]$nextAudit, [parameter(mandatory = $false)] [string]$url, @@ -50,7 +53,7 @@ function New-SnipeitAudit() { } if ($PSBoundParameters.ContainsKey('nextAudit')) { - $Values += @{"next_audit_date" = $nextAudit} + $Values += @{"next_audit_date" = ($nextAudit).ToString("yyyy-MM-dd")} } $Parameters = @{