diff --git a/scripts/list-wsl-distros.ps1 b/scripts/list-wsl-distros.ps1 index 7ae286f1..5a554a2a 100755 --- a/scripts/list-wsl-distros.ps1 +++ b/scripts/list-wsl-distros.ps1 @@ -1,4 +1,22 @@ -& wsl.exe --list --online -" " -& wsl.exe --status -exit 0 # success \ No newline at end of file +<# +.SYNOPSIS + Lists distros for Windows Subsystem for Linux +.DESCRIPTION + This PowerShell script lists available Linux distributions for Windows Subsystem for Linux (WSL). +.EXAMPLE + PS> ./list-wsl-distros.ps1 +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +try { + & wsl.exe --list --online + " " + & wsl.exe --status + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} \ No newline at end of file