Skip to content

Commit 3cc8135

Browse files
committed
vm.common: add -iconLocation param to VM-Install-From-Zip function
1 parent 87caee3 commit 3cc8135

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
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)