A
A
andreystrelkov2015-11-11 16:03:38
PowerShell
andreystrelkov, 2015-11-11 16:03:38

Is it possible in PowerShell to make a timer wait for a specific time?

Please tell me, is it possible to insert a timer in the middle of the script, which will not count seconds, but will wait until it is 18:45 according to the system time - then continue executing the rest of the script?

Answer the question

In order to leave comments, you need to log in

8 answer(s)
A
ace_foster, 2015-11-12
@ace_foster

Could be so

$StartDate=(Get-Date) # текущая дата
$EndDate = [datetime]”11/12/2015 17:50” # необходимая дата и время. формат м/д/г

$secs_towait = (New-TimeSpan –Start $StartDate –End $EndDate).Seconds # выгружаем информацию о разнице в секундах
Start-Sleep -Seconds $secs_towait # приостанавливаем выполнение программы на $secs_towait секунд

S
Sergey SA, 2015-11-11
@resetsa

Yes, but you have to use .NET
You can of course use a crooked solution like this

PS C:\Users\sst> $a=[datetime]::now.date
PS C:\Users\sst> $a=$a.addhours(16)
PS C:\Users\sst> $a=$a.addminutes(40)
PS C:\Users\sst> $a

11 ноября 2015 г. 16:40:00

PS C:\Users\sst> start-sleep ($a-[datetime]::now).totalseconds;write "timer"

D
Denis Ineshin, 2013-12-03
@ru_bender

This is a table. Use it for this task. Those. not the table itself, but display:table, table-cell

E
Eugene Mosyukov, 2013-12-03
@GeneMoss

The simplest, like this: dabblet.com/gist/7766924

S
Sergey Larionov, 2013-12-03
@Zidar

For a block with text, it is enough to specify overflow: hidden;

A
Artur Smirnov, 2013-12-03
@artursmirnov

Just give the text block a float CSS attribute. Here you can see: example

C
Crash, 2013-12-03
@Bandicoot

Create 2 blocks, in one picture, in the other text. Image with float: left, text with float: right in css styles

A
Anton, 2013-12-03
@Mew

Image float: left, text overflow: hidden;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question