Skip to content

Commit

Permalink
Merge pull request #257 from PetriAsi/patch-1
Browse files Browse the repository at this point in the history
@RussellLeVasseur :  Add Next Audit Date to New-SnipeItAudit.ps1
  • Loading branch information
PetriAsi authored Feb 5, 2022
2 parents 7ac8a5c + e321cd3 commit 72c6ccb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions SnipeitPS/Public/New-SnipeitAudit.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -28,6 +31,9 @@ function New-SnipeitAudit() {

[int]$location_id,

[parameter(mandatory = $false)]
[datetime]$next_audit_date,

[parameter(mandatory = $false)]
[string]$url,

Expand All @@ -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"
Expand Down

0 comments on commit 72c6ccb

Please sign in to comment.