Reply to post: Re: I love WSL, since it made scripting on Windows usable after 30 years :)

Want to spin up Ubuntu VMs from Windows 10's command line, eh? We'll need to see a Multipass

barstewardsquad
Coat

Re: I love WSL, since it made scripting on Windows usable after 30 years :)

There are probably simpler and more elegant ways but this works for me.

date([management.managementdatetimeconverter]::ToDateTime((Get-WmiObject win32_operatingsystem).LastBootUpTime)) -Format dd-M-yyyy

I would normally do the date as yyyyMMdd but wanted to match it to the OP's format.

Mine is the one with a windows VM on linux because Azure modules don't work properly on Linux Powershell

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon