diff --git a/packages/common.vm/common.vm.nuspec b/packages/common.vm/common.vm.nuspec index 79076e2e..1f8934e6 100755 --- a/packages/common.vm/common.vm.nuspec +++ b/packages/common.vm/common.vm.nuspec @@ -2,7 +2,7 @@ common.vm - 0.0.0.20241106 + 0.0.0.20241209 Common libraries for VM-packages Mandiant diff --git a/packages/common.vm/tools/vm.common/vm.common.psm1 b/packages/common.vm/tools/vm.common/vm.common.psm1 index 6a54eb2a..ca0d6159 100755 --- a/packages/common.vm/tools/vm.common/vm.common.psm1 +++ b/packages/common.vm/tools/vm.common/vm.common.psm1 @@ -1762,10 +1762,18 @@ function VM-Install-With-Pip { [Parameter(Mandatory=$true)] [string] $category, [Parameter(Mandatory=$false)] + [string] $version = "", + [Parameter(Mandatory=$false)] [string] $arguments = "--help" ) try { - VM-Pip-Install $toolName + # Conditionally add version string + $toolNameForPip = $toolName + if (![string]::IsNullOrEmpty($version)) { # Check if $version is not empty or null + $toolNameForPip += "==$version" + } + + VM-Pip-Install $toolNameForPip $executablePath = "$(where.exe $toolName)" VM-Install-Shortcut $toolName $category $executablePath -consoleApp $true -arguments $arguments