From e310a250c4313bf576948b0941eb3a78a5d2ac05 Mon Sep 17 00:00:00 2001 From: vm-packages Date: Fri, 2 Feb 2024 01:06:03 +0000 Subject: [PATCH] Add vscode.vm Closes https://github.com/mandiant/VM-Packages/issues/887. --- packages/vscode.vm/tools/chocolateyinstall.ps1 | 16 ++++++++++++++++ packages/vscode.vm/tools/chocolateyuninstall.ps1 | 7 +++++++ packages/vscode.vm/vscode.vm.nuspec | 13 +++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 packages/vscode.vm/tools/chocolateyinstall.ps1 create mode 100644 packages/vscode.vm/tools/chocolateyuninstall.ps1 create mode 100644 packages/vscode.vm/vscode.vm.nuspec diff --git a/packages/vscode.vm/tools/chocolateyinstall.ps1 b/packages/vscode.vm/tools/chocolateyinstall.ps1 new file mode 100644 index 000000000..83d419d79 --- /dev/null +++ b/packages/vscode.vm/tools/chocolateyinstall.ps1 @@ -0,0 +1,16 @@ +$ErrorActionPreference = 'Stop' +Import-Module vm.common -Force -DisableNameChecking + +try { + $toolName = 'VSCode' + $category = 'Text Editors' + $shimPath = 'Unable to locate one' + + $shortcutDir = Join-Path ${Env:TOOL_LIST_DIR} $category + $shortcut = Join-Path $shortcutDir "$toolName.lnk" + $executablePath = Join-Path ${Env:ChocolateyInstall} $shimPath -Resolve + VM-Install-Shortcut -toolName $toolName -category $category -executablePath $executablePath -runAsAdmin + VM-Assert-Path $shortcut +} catch { + VM-Write-Log-Exception $_ +} diff --git a/packages/vscode.vm/tools/chocolateyuninstall.ps1 b/packages/vscode.vm/tools/chocolateyuninstall.ps1 new file mode 100644 index 000000000..121d16cdb --- /dev/null +++ b/packages/vscode.vm/tools/chocolateyuninstall.ps1 @@ -0,0 +1,7 @@ +$ErrorActionPreference = 'Continue' +Import-Module vm.common -Force -DisableNameChecking + +$toolName = 'VSCode' +$category = 'Text Editors' + +VM-Remove-Tool-Shortcut $toolName $category diff --git a/packages/vscode.vm/vscode.vm.nuspec b/packages/vscode.vm/vscode.vm.nuspec new file mode 100644 index 000000000..a817ec832 --- /dev/null +++ b/packages/vscode.vm/vscode.vm.nuspec @@ -0,0 +1,13 @@ + + + + vscode.vm + 1.85.2 + Microsoft + VSCode is a modern, open-source code editor. + + + + + +