1
0
Fork 0

[WINDOWS] Autoconfig WSL

This commit is contained in:
Florian RICHER (MrDev023) 2021-10-27 22:07:57 +02:00
parent 612579bb34
commit 5fb93a3d3e
3 changed files with 13 additions and 1 deletions

View file

@ -48,4 +48,16 @@ Set-PSReadLineOption @PSReadLineOptions
'@ | Out-File -FilePath $PROFILE -Append
# Reload profile
. $PROFILE
. $PROFILE
# Configure WSL
Get-Command wsl
if ($? -eq $True) {
$linuxWindowsConfPath = (Get-Location).Path.Replace('C:', '/mnt/c').Replace('\', '/')
$linuxHomeConfPath = "/home/$(wsl -e 'whoami')/myconf"
bash -c "ln -s $linuxWindowsConfPath $linuxHomeConfPath"
bash -c "$linuxHomeConfPath/install.sh"
} else {
Write-Output 'WSL is not installed. Ignore...'
}