3 ms·
You thought wrong. It's installed and enabled by default. > Even those little things like being able to format arbitrary dates as you want... You mean like
by ygra 12y ago
You thought wrong. It's installed and enabled by default.
> Even those little things like being able to format arbitrary dates as you want...
You mean like
$someDate.ToString('yyyy-MM-dd')
'Today: {0:yyyy-MM-dd}' -f (Get-Date)
Get-Date -Format yyyy-MM-dd
date -f yyyy-MM-dd
Right, that's excruciatingly hard in PowerShell (hey, you even get Unix date format strings with Get-Date -UFormat). (But I guess we just come from different worlds here, as every time I have to read or write bash scripts it makes me appreciate PowerShell so much more.) Granted, the batch variant is ... not as pretty:
for /f "skip=1" %%x in ('wmic os get localdatetime') do if not defined MyDate set MyDate=%%x
echo Today: %MyDate:~0,4%-%MyDate:~4,2%-%MyDate:~6,2%
And I found the PowerShell script alongside with the batch file a pretty workable solution. Nicer language and still something for clueless users to double-click.