mirror of
https://github.com/safing/portbase
synced 2025-09-01 18:19:57 +00:00
Implement review suggestions
This commit is contained in:
parent
2b91472204
commit
3b2b4c052b
1 changed files with 3 additions and 3 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Reference in a new issue