Skip to content

Commit

Permalink
Update New-LogEntry.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
adbertram authored Apr 15, 2017
1 parent 779059c commit 6435c3f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Text Files/New-LogEntry.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function New-LogEntry {
function New-LogEntry {
<#
.SYNOPSIS
This function appends a row to a tab-separated text file with a timestamp, log message and a time
Expand Down Expand Up @@ -46,14 +46,14 @@
foreach ($Value in $Values) {
$Split = $Value.Split(' ')
$Value = $Split[0]
$Label = $Split[1]
if ($AllowedLabels -notcontains $Label) {
Write-Error "The label '$Label' is not a valid time label"
return $false
} elseif ($Value -notmatch '^\d+$') {
Write-Error "The time value '$Value' is not a valid time interval"
return $false
} else {
$Label = $Split[1]
## Make the label plural (if it's not already) to match New-TimeSpan's property name
if ($Label.Substring($Label.Length - 1, 1) -ne 's') {
$Label = $Label + 's'
Expand Down Expand Up @@ -96,4 +96,4 @@
$false
}
}
}
}

0 comments on commit 6435c3f

Please sign in to comment.