Skip to content

Commit

Permalink
refactor(ps): wsl_wslg - change parameter name
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonos committed Oct 11, 2023
1 parent c7a4658 commit a40f552
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions wsl/wsl_wslg.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ Enable/disable WSLg.
Specify the value to true or false to enable/disable WSLg.
.EXAMPLE
wsl/wsl_wslg.ps1 -WSLg 'true'
wsl/wsl_wslg.ps1 -WSLg 'false'
wsl/wsl_wslg.ps1 -GuiApplications 'true'
wsl/wsl_wslg.ps1 -GuiApplications 'false'
#>
[CmdletBinding()]
param (
[Parameter(Mandatory, Position = 0)]
[ValidateSet('true', 'false')]
[string]$WSLg
[string]$GuiApplications
)

begin {
Expand All @@ -36,14 +36,14 @@ process {
if (Test-Path "$HOME/.wslconfig") {
$wslConfig = Get-Content -Path "$HOME/.wslconfig" | ConvertFrom-Cfg
if ($wslConfig.wsl2) {
$wslConfig.wsl2.guiApplications = $WSLg
$wslConfig.wsl2.guiApplications = $GuiApplications
} else {
$wslConfig.wsl2 = @{ guiApplications = $WSLg }
$wslConfig.wsl2 = @{ guiApplications = $GuiApplications }
}
} else {
$wslConfig = [ordered]@{
wsl2 = @{
guiApplications = $WSLg
guiApplications = $GuiApplications
}
}
}
Expand All @@ -54,5 +54,5 @@ process {
}

end {
Write-Host "WSLg $($WSLg -eq 'true' ? 'enabled': 'disabled')."
Write-Host "WSLg $($GuiApplications -eq 'true' ? 'enabled': 'disabled')."
}

0 comments on commit a40f552

Please sign in to comment.