Skip to content

Commit 90f3b30

Browse files
committed
fix(powershell): Undo the math calc that works
Signed-off-by: Greg Althaus <[email protected]>
1 parent c62a0f5 commit 90f3b30

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

builder/hyperv/common/powershell/powershell.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,13 @@ func createArgs(filename string, params ...string) []string {
196196

197197
func GetHostAvailableMemory() float64 {
198198

199-
var script = "(Get-WmiObject Win32_OperatingSystem).FreePhysicalMemory"
199+
var script = "(Get-WmiObject Win32_OperatingSystem).FreePhysicalMemory / 1024"
200200

201201
var ps PowerShellCmd
202202
output, _ := ps.Output(script)
203203

204204
freeMB, _ := strconv.ParseFloat(output, 64)
205205

206-
freeMB = freeMB / 1024.0
207-
208206
return freeMB
209207
}
210208

0 commit comments

Comments
 (0)