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

phuzz Silver badge

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

Try that in PowerShell.

Ok then:

Get-CimInstance -ClassName win32_operatingsystem | select lastbootuptime

(Note how instead of having to manipulate strings using multiple programs, we just grab the one field we're interested in, which is returned as a DateTime so we don't have to reformat it if we wanted to use it in a script.)

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