From 3b2b4c052beeccdeecc2aa96459bbfdde953e452 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 17 Nov 2020 10:04:32 +0100 Subject: [PATCH] Implement review suggestions --- utils/osdetail/binmeta_windows.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/osdetail/binmeta_windows.go b/utils/osdetail/binmeta_windows.go index 6a7bb6b..01650f4 100644 --- a/utils/osdetail/binmeta_windows.go +++ b/utils/osdetail/binmeta_windows.go @@ -7,7 +7,7 @@ import ( "strings" ) -const powershellGetFileDescription = `Get-ItemProperty "%s" | Format-List` +const powershellGetFileDescription = `Get-ItemProperty %q | Format-List` // GetBinaryNameFromSystem queries the operating system for a human readable // name for the given binary path. @@ -44,7 +44,7 @@ func GetBinaryNameFromSystem(path string) (string, error) { } const powershellGetIcon = `Add-Type -AssemblyName System.Drawing -$Icon = [System.Drawing.Icon]::ExtractAssociatedIcon("%s") +$Icon = [System.Drawing.Icon]::ExtractAssociatedIcon(%q) $MemoryStream = New-Object System.IO.MemoryStream $Icon.save($MemoryStream) $Bytes = $MemoryStream.ToArray() @@ -84,7 +84,7 @@ $MemoryStream.Dispose() */ // GetBinaryIconFromSystem queries the operating system for the associated icon -// for a given binary path. +// for a given binary path and returns it as a data-URL. func GetBinaryIconFromSystem(path string) (string, error) { // Get Associated File Icon via Powershell call. output, err := runPowershellCmd(fmt.Sprintf(powershellGetIcon, path))