Exceptions and spacing

This commit is contained in:
KevinMarquette
2017-05-02 23:50:22 -07:00
parent e4822cb810
commit 958ada59e4
6 changed files with 95 additions and 82 deletions

View File

@@ -1,4 +1,3 @@
function Write-ScriptLine
{
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingWriteHost", "")]

View File

@@ -1,5 +1,3 @@
function Format-Chronometer
{
<#
@@ -44,6 +42,8 @@ function Format-Chronometer
)
process
{
try
{
foreach ( $script in $InputObject )
{
@@ -62,4 +62,9 @@ function Format-Chronometer
Write-ScriptLine $command -WarningAt $WarningAt -ErrorAt $ErrorAt
}
}
catch
{
$PSCmdlet.ThrowTerminatingError($PSItem)
}
}
}

View File

@@ -27,9 +27,12 @@ function Get-Chronometer
[alias('Script', 'CommandScript')]
[scriptblock]
$ScriptBlock
)
process
{
try
{
if ( $null -eq $Path )
{
$Path = Get-ChildItem -Recurse -Include *.psm1, *.ps1 -File
@@ -67,3 +70,9 @@ function Get-Chronometer
Write-Warning "Parsing files did not result in any breakpoints"
}
}
catch
{
$PSCmdlet.ThrowTerminatingError($PSItem)
}
}
}