Skip to content

Commit

Permalink
Add Version Argument to VM-Install-With-Pip
Browse files Browse the repository at this point in the history
  • Loading branch information
emtuls committed Dec 10, 2024
1 parent 4ccd41a commit 63851c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/common.vm/common.vm.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>common.vm</id>
<version>0.0.0.20241106</version>
<version>0.0.0.20241209</version>
<description>Common libraries for VM-packages</description>
<authors>Mandiant</authors>
</metadata>
Expand Down
10 changes: 9 additions & 1 deletion packages/common.vm/tools/vm.common/vm.common.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 63851c6

Please sign in to comment.