Hi,
Please see if this works for you
$1second=[timespan]'0:0:0:1'
$ts1=[timespan]'0:0:30:0'
$label.Text = $ts1.ToString('hh\:mm\:ss')
$timer1 = New-Object system.Windows.Forms.timer
$timer1.Interval = 1000
$timer1.add_tick({
$script:ts1=$ts1.Subtract($1second)
$label.Text = $ts1.ToString('hh\:mm\:ss')
if($ts1.Ticks -le 0){
$timer1.Stop()
}
})
$timer1.Start()
Best Regards,
Ian
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.