Can you tell what was the day of the week on date 01/01/2015 ?
or what was the day of the week on your last or next birthday ?
this hard questions are really easy to solve ..by powershell of-course all you need to do is open the PS Console
and type –
1 |
Get-Date -Date 01/01/2015 |
what did you get ?
we can set the date with different format as we wish ,example –
1 |
Get-Date -Format yyyy-MM-dd |
what about the Time ?
1 |
Get-Date -Format HH:mm:ss:ms |
now ..we can get the date and time just by entering the command Get-Date
but lets wrap it up with style –
1 2 3 4 |
$date = Get-Date -Format yyyy-MM-dd $time = get-date -Format HH:mm:ss $datetime = $date + "|" + $time $datetime |
here’s a quiz 🙂
can you get all Sundays since 01/01/2013 ?
if so ..send your script to PSAdmin@POSHDB.COM
(Visited 21,861 times, 1 visits today)