Skip to content

Commit f3391bb

Browse files
authored
Merge pull request #259 from snazy2000/develop
Added: Next Audit Date to New-SnipeItAudit.ps1
2 parents 9e014ad + 5aa6a2e commit f3391bb

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
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"

docs/New-SnipeitAudit.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Add a new Audit to Snipe-it asset system
1313
## SYNTAX
1414

1515
```
16-
New-SnipeitAudit [-tag] <String> [[-location_id] <Int32>] [[-url] <String>] [[-apiKey] <String>] [-WhatIf]
17-
[-Confirm] [<CommonParameters>]
16+
New-SnipeitAudit [-tag] <String> [[-location_id] <Int32>] [[-next_audit_date] <DateTime>] [[-url] <String>]
17+
[[-apiKey] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
1818
```
1919

2020
## DESCRIPTION
@@ -38,7 +38,7 @@ Parameter Sets: (All)
3838
Aliases:
3939

4040
Required: False
41-
Position: 4
41+
Position: 5
4242
Default value: None
4343
Accept pipeline input: False
4444
Accept wildcard characters: False
@@ -59,6 +59,21 @@ Accept pipeline input: False
5959
Accept wildcard characters: False
6060
```
6161
62+
### -next_audit_date
63+
Due date for the asset's next audit
64+
65+
```yaml
66+
Type: DateTime
67+
Parameter Sets: (All)
68+
Aliases:
69+
70+
Required: False
71+
Position: 3
72+
Default value: None
73+
Accept pipeline input: False
74+
Accept wildcard characters: False
75+
```
76+
6277
### -tag
6378
The asset tag of the asset you wish to audit
6479
@@ -83,7 +98,7 @@ Parameter Sets: (All)
8398
Aliases:
8499

85100
Required: False
86-
Position: 3
101+
Position: 4
87102
Default value: None
88103
Accept pipeline input: False
89104
Accept wildcard characters: False

0 commit comments

Comments
 (0)