From ca1d7ebd093e62669f34c018c09511c21dbcf046 Mon Sep 17 00:00:00 2001 From: aby913 Date: Thu, 27 Nov 2025 23:55:23 +0800 Subject: [PATCH] cli: windows username contains spaces (#2124) fix: windows username contains spaces --- cli/pkg/windows/tasks.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/pkg/windows/tasks.go b/cli/pkg/windows/tasks.go index b8e507c3d..4c8ce424f 100644 --- a/cli/pkg/windows/tasks.go +++ b/cli/pkg/windows/tasks.go @@ -78,7 +78,7 @@ func (i *InstallAppxPackage) Execute(runtime connector.Runtime) error { wslAppxPackage := wslAppxPackageObj.(*files.KubeBinary) var ps = &utils.PowerShellCommandExecutor{ - Commands: []string{fmt.Sprintf("Add-AppxPackage %s -ForceUpdateFromAnyVersion", wslAppxPackage.Path())}, + Commands: []string{fmt.Sprintf("Add-AppxPackage \"%s\" -ForceUpdateFromAnyVersion", wslAppxPackage.Path())}, } if _, err := ps.Run(); err != nil { @@ -216,7 +216,7 @@ func (i *InstallWSLDistro) Execute(runtime connector.Runtime) error { logger.Infof("%s path: %s", ubuntuTool, installerPath) var checkInstallerPs = &utils.PowerShellCommandExecutor{ - Commands: []string{fmt.Sprintf("Test-Path %s", installerPath)}, + Commands: []string{fmt.Sprintf("Test-Path \"%s\"", installerPath)}, } installerExists, err := checkInstallerPs.Run() if err != nil {