Elevated cmd
Code:
C:\Windows\system32>wsl --set-version Ubuntu 2
Invalid command line option: --set-version
Copyright (c) Microsoft Corporation. All rights reserved.
Usage: wsl.exe [Argument] [Options...] [CommandLine]
Arguments to run Linux binaries:
If no command line is provided, wsl.exe launches the default shell.
--exec, -e <CommandLine>
Execute the specified command without using the default Linux shell.
--
Pass the remaining command line as is.
Options:
--distribution, -d <DistributionName>
Run the specified distribution.
--user, -u <UserName>
Run as the specified user.
Arguments to manage Windows Subsystem for Linux:
--export <DistributionName> <FileName>
Exports the distribution to a tar file.
The filename can be - for standard output.
--import <DistributionName> <InstallLocation> <FileName>
Imports the specified tar file as a new distribution.
The filename can be - for standard input.
--list, -l [Options]
Lists distributions.
Options:
--all
List all distributions, including distributions that are currently
being installed or uninstalled.
--running
List only distributions that are currently running.
-setdefault, -s <DistributionName>
Sets the distribution as the default.
--terminate, -t <DistributionName>
Terminates the distribution.
--unregister <DistributionName>
Unregisters the distribution.
--upgrade <DistributionName>
Upgrades the distribution to the WslFs file system format.
--help
Display usage information.
C:\Windows\system32>
Powershell
Code:
PS C:\Windows\system32> wsl --set-version Ubuntu 2
wsl : The term 'wsl' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a
path was included, verify that the path is correct and try again.
At line:1 char:1
+ wsl --set-version Ubuntu 2
+ ~~~
+ CategoryInfo : ObjectNotFound: (wsl:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Windows\system32>