Skip to content

Commit 777a5c4

Browse files
committed
vm.common: add -iconLocation param to VM-Install-From-Zip function
1 parent 5fe6f9d commit 777a5c4

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

packages/common.vm/common.vm.nuspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
33
<metadata>
44
<id>common.vm</id>
5-
<version>0.0.0.20241106</version>
5+
<version>0.0.0.20241212</version>
66
<description>Common libraries for VM-packages</description>
77
<authors>Mandiant</authors>
88
</metadata>

packages/common.vm/tools/vm.common/vm.common.psm1

+6-4
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,9 @@ function VM-Install-From-Zip {
402402
# $powershellCommand = "Get-Content README.md"
403403
# $powershellCommand = "Import-Module module.ps1; Get-Help Main-Function"
404404
[Parameter(Mandatory=$false)]
405-
[string] $powershellCommand
405+
[string] $powershellCommand,
406+
[Parameter(Mandatory=$false)]
407+
[string] $iconLocation
406408
)
407409
try {
408410
$toolDir = Join-Path ${Env:RAW_TOOLS_DIR} $toolName
@@ -432,20 +434,20 @@ function VM-Install-From-Zip {
432434

433435
if ($powershellCommand) {
434436
$executablePath = $toolDir
435-
VM-Install-Shortcut -toolName $toolName -category $category -arguments $powershellCommand -executableDir $executablePath -powershell
437+
VM-Install-Shortcut -toolName $toolName -category $category -arguments $powershellCommand -executableDir $executablePath -powershell -iconLocation $iconLocation
436438
}
437439
elseif ($withoutBinFile) { # Used when tool does not have an associated executable
438440
if (-Not $executableName) { # Tool is located in $toolDir (c3.vm for example)
439441
$executablePath = $toolDir
440442
} else { # Tool is in a specific directory (pma-labs.vm for example)
441443
$executablePath = Join-Path $toolDir $executableName -Resolve
442444
}
443-
VM-Install-Shortcut -toolName $toolName -category $category -executablePath $executablePath
445+
VM-Install-Shortcut -toolName $toolName -category $category -executablePath $executablePath -iconLocation $iconLocation
444446
}
445447
else {
446448
if (-Not $executableName) { $executableName = "$toolName.exe" }
447449
$executablePath = Join-Path $toolDir $executableName -Resolve
448-
VM-Install-Shortcut -toolName $toolName -category $category -executablePath $executablePath -consoleApp $consoleApp -arguments $arguments
450+
VM-Install-Shortcut -toolName $toolName -category $category -executablePath $executablePath -consoleApp $consoleApp -arguments $arguments -iconLocation $iconLocation
449451
Install-BinFile -Name $toolName -Path $executablePath
450452
}
451453
return ,@($toolDir, $executablePath)

0 commit comments

Comments
 (0)