Skip to content

Commit

Permalink
fix: trim slash in RemoveSmbGlobalMapping
Browse files Browse the repository at this point in the history
  • Loading branch information
andyzhangx committed Apr 19, 2024
1 parent ec56cd2 commit f09cb7d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/os/smb/smb.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func NewSmbGlobalMapping(remotePath, username, password string) error {
}

func RemoveSmbGlobalMapping(remotePath string) error {
remotePath = strings.TrimSuffix(remotePath, `\`)
cmd := `Remove-SmbGlobalMapping -RemotePath $Env:smbremotepath -Force`
klog.V(2).Infof("begin to run RemoveSmbGlobalMapping with %s", remotePath)
if output, err := util.RunPowershellCmd(cmd, fmt.Sprintf("smbremotepath=%s", remotePath)); err != nil {
Expand Down

0 comments on commit f09cb7d

Please # to comment.