external help file | Module Name | online version | schema |
---|---|---|---|
PSTimers-help.xml |
PSTimers |
2.0.0 |
Start a simple timer.
Start-MyTimer [[-Name] <String[]>] [-Description <String>] [<CommonParameters>]
This command starts a simple timer. You start it, which captures the current date and time, and stores the result in a global variable. You have the option of naming your timer which will allow you to have multiple timers running at the same time. Timer names must be unique. You can also add a brief description.
Timers are managed through two hashtables created as global variables, $MyTimerCollection and $MyWatchCollection. Do not delete these variables. The MyTimer commands will update these hashtables as needed.
PS C:\> Start-MyTimer
Start the timer with the default name of MyTimer.
PS C:\> Start-MyTimer Timer2
Name Start Stop Duration Running Description
---- ----- ---- -------- ------- -----------
timer2 12/12/2022 11:09:25 AM 00:00:00 True
Create a second timer called Timer2.
PS C:\> Start-MyTimer Z -Description "work stuff"
Name Start Stop Duration Running Description
---- ----- ---- -------- ------- -----------
Z 12/12/2022 11:10:16 AM 00:00:00 True work stuff
Create a new timer with a description.
PS C:\> Start-MyTimer alpha,bravo,charlie
Name Start Stop Duration Running Description
---- ----- ---- -------- ------- -----------
a 12/12/2022 11:11:10 AM 00:00:00 True
b 12/12/2022 11:11:10 AM 00:00:00 True
c 12/12/2022 11:11:10 AM 00:00:00 True
Create multiple timers at once.
The name for your timer. You can create multiple timers at the same time. See examples.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 0
Default value: MyTimer
Accept pipeline input: False
Accept wildcard characters: False
Enter an optional description for this timer.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/