Skip to content

Commit 72c6ccb

Browse files
authored
Merge pull request #257 from PetriAsi/patch-1
@RussellLeVasseur : Add Next Audit Date to New-SnipeItAudit.ps1
2 parents 7ac8a5c + e321cd3 commit 72c6ccb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

SnipeitPS/Public/New-SnipeitAudit.ps1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ Long description
88
.PARAMETER Tag
99
The asset tag of the asset you wish to audit
1010
11+
.PARAMETER next_audit_date
12+
Due date for the asset's next audit
13+
1114
.PARAMETER Location_id
1215
ID of the location you want to associate with the audit
1316
@@ -28,6 +31,9 @@ function New-SnipeitAudit() {
2831

2932
[int]$location_id,
3033

34+
[parameter(mandatory = $false)]
35+
[datetime]$next_audit_date,
36+
3137
[parameter(mandatory = $false)]
3238
[string]$url,
3339

@@ -45,6 +51,10 @@ function New-SnipeitAudit() {
4551
if ($PSBoundParameters.ContainsKey('tag')) {
4652
$Values += @{"asset_tag" = $tag}
4753
}
54+
55+
if ($PSBoundParameters.ContainsKey('next_audit_date')) {
56+
$Values += @{"next_audit_date" = ($next_audit_date).ToString("yyyy-MM-dd")}
57+
}
4858

4959
$Parameters = @{
5060
Api = "/api/v1/hardware/audit"

0 commit comments

Comments
 (0)