Skip to content

Commit

Permalink
Issue #758 Force encoding for GetDefaultSwitchName
Browse files Browse the repository at this point in the history
  • Loading branch information
gbraad authored and praveenkumar committed Nov 1, 2019
1 parent 4665025 commit 918a7e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/os/windows/network/vswitch_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
const hypervDefaultVirtualSwitchId = "c08cb7b8-9b3c-408e-8e30-5e16a3aeb444"

func GetDefaultSwitchName() (bool, string) {
getDefaultSwitchNameCmd := fmt.Sprintf("Get-VMSwitch -Id %s | ForEach-Object { $_.Name }", hypervDefaultVirtualSwitchId)
getDefaultSwitchNameCmd := fmt.Sprintf("[Console]::OutputEncoding = [Text.Encoding]::UTF8; Get-VMSwitch -Id %s | ForEach-Object { $_.Name }", hypervDefaultVirtualSwitchId)
stdOut, stdErr, _ := powershell.Execute(getDefaultSwitchNameCmd)

// If stdErr contains the command then execution failed
Expand Down

0 comments on commit 918a7e1

Please sign in to comment.