From f87c62e33405b355bbcec601cc57b18b3a8c9e67 Mon Sep 17 00:00:00 2001 From: Ana Maria Martinez Gomez Date: Wed, 8 May 2024 14:49:13 +0200 Subject: [PATCH] [common.vm] Fix VM-Uninstall-IDA-Plugin The string `VM-Get-IDA-Plugins-Dir` was being used instead of calling the function. In `Remove-Item` we need `-Force` to remove read-only and hidden files, `-Recurse` to remove directories, and `- ea 0` because of a bug with the `ErrorActionPreference`. --- packages/common.vm/common.vm.nuspec | 2 +- packages/common.vm/tools/vm.common/vm.common.psm1 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/common.vm/common.vm.nuspec b/packages/common.vm/common.vm.nuspec index 02e7c5da5..4b642f964 100755 --- a/packages/common.vm/common.vm.nuspec +++ b/packages/common.vm/common.vm.nuspec @@ -2,7 +2,7 @@ common.vm - 0.0.0.20240429 + 0.0.0.20240508 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 2f13aa18f..b352ec33c 100755 --- a/packages/common.vm/tools/vm.common/vm.common.psm1 +++ b/packages/common.vm/tools/vm.common/vm.common.psm1 @@ -366,8 +366,8 @@ function VM-Uninstall-IDA-Plugin { [Parameter(Mandatory=$true)] [string] $pluginName # Example: capa_explorer.py ) - $pluginPath = Join-Path VM-Get-IDA-Plugins-Dir $pluginName - Remove-Item $pluginPath + $pluginPath = Join-Path (VM-Get-IDA-Plugins-Dir) $pluginName + Remove-Item $pluginPath -Recuse -Force -ea 0 } # This functions returns $toolDir and $executablePath