File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ function Invoke-ScriptWithLogging {
3434
3535
3636$script :startTime = Get-Date
37+ $scriptName = $MyInvocation.MyCommand.Name
3738
3839function Write-ElapsedTime {
3940 [CmdletBinding ()]
@@ -43,7 +44,7 @@ function Write-ElapsedTime {
4344 )
4445
4546 $elapsedTime = [math ]::Round(((Get-Date ) - $script :startTime ).TotalSeconds, 1 )
46- Write-Host " ${ Message} . Total elapsed time: $elapsedTime seconds"
47+ Write-Host " [ ${scriptName} ] ${ Message} . Total elapsed time: $elapsedTime seconds. "
4748 Write-Host " "
4849}
4950
@@ -305,6 +306,4 @@ finally {
305306 Pop-Location
306307}
307308
308- $scriptName = $MyInvocation.MyCommand.Name
309-
310- Write-ElapsedTime " ${scriptName} completed"
309+ Write-ElapsedTime " Script completed"
You can’t perform that action at this time.
0 commit comments