On the road achieving it there is some idiotic ideas of the WSL what I want to write about.
My first thought, you can check the WSL installation status from in the Windows features list. It can be achieved from PowerShell:
Just guess the WSL is installed on my PC, or not!
According to the DISM it is not installed.
But if I list the running Linux systems:
My WSL based AZDO agent is already running.
How this is possible? The DISM is not the only way to install WSL. You can install it with the following command:
wsl --install --no-distribution --web-download
The internet sources suggest to use wsl -l -v but that just show the running Linux instances. If you install it with the command above, the list will be empty.
What I figured out is the following:
$WSL_STATUS = wsl --status
if($WSL_STATUS) {
Write-Host "WSL already installed"
} else {
Write-Host "WSL not installed"
}
Why? The status will be empty if not installed and will report the WSL default version and other settings if installed.
Why this is required? The installation of the WSL engine itself require reboot. As I'm writing an automated script it is crucial to know if I need reboot or not.
Continued...
Nincsenek megjegyzések:
Megjegyzés küldése