Allows you to switch the activation of certain services from one WSL instance to another.
The following services are currently managed, but you can custom it in the config.json
file:
- apache
- mysql
- php
Add the bucket scoop-srsrns.
Then install it directly from this bucket:
scoop bucket add srsrns https://github.com/mbl-35/scoop-srsrns
scoop install wsl-switch
To uninstall it, simply use scoop uninstall wsl-switch
Download the latest build from GitHub.
Unzip it then add the path to the ps1 file in your Powershell profile:
Invoke-Item $Profile
# Set-Alias wsl-switch _path_to_repository_\wsl-switch.ps1
You need to run the following command to edit the configuration file.
wsl-switch config
It will open the config.json
file that you can edit.
Save it, and it will direcly be used by the application.
To enable the service $service
on $hostname
, you'll need to type the following command:
wsl-switch $service $hostname
The $hostname
parameter is the key
stored in the config.json
.
You can switch all configured services at once by using the parameter all
instead of $service
.
To install multiple WSL instances easier, you can use WSLCTL.
It provides a single command to create, backup and manage WSL instances.