Created
January 7, 2017 07:28
-
-
Save brianbunke/7a913118b9c7af10cd6456ee5e4c24be to your computer and use it in GitHub Desktop.
Illustrating the initial effects of "Update-ScriptFileInfo -Force"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#PSScriptInfo | |
.VERSION 1.0 | |
.GUID a9323abc-0567-4c4f-ad8e-cdd4cb236e3a | |
.AUTHOR Brian | |
.COMPANYNAME | |
.COPYRIGHT | |
.TAGS | |
.LICENSEURI | |
.PROJECTURI | |
.ICONURI | |
.EXTERNALMODULEDEPENDENCIES | |
.REQUIREDSCRIPTS | |
.EXTERNALSCRIPTDEPENDENCIES | |
.RELEASENOTES | |
#> | |
<# | |
.DESCRIPTION | |
testing | |
#> | |
Param() | |
function Measure-LastCommand { | |
<#...#> # stripped here just for brevity's sake | |
[CmdletBinding()] | |
param (...) # also stripped here for brevity | |
If ($ID) { | |
$Command = Get-History -Id $ID | |
} Else { | |
$Command = Get-History -Count 1 | |
} | |
Write-Verbose "Returning the elapsed time of command: $($Command.CommandLine)" | |
If ($String) { | |
(New-TimeSpan -Start $Command.StartExecutionTime -End $Command.EndExecutionTime).ToString('d\:hh\:mm\:ss\.fff') | |
} Else { | |
New-TimeSpan -Start $Command.StartExecutionTime -End $Command.EndExecutionTime | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment