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.
> Even those little things like being able to format arbitrary dates as you want...
You mean like
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: 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.