Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Illustrating the initial effects of "Update-ScriptFileInfo -Force"
<#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
You can’t perform that action at this time.