Skip to content

Commit

Permalink
Add netcat.vm
Browse files Browse the repository at this point in the history
Closes #735.
  • Loading branch information
vm-packages committed Nov 9, 2023
1 parent 49165ef commit 84168ff
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/netcat.vm/netcat.vm.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>netcat.vm</id>
<version>1.12</version>
<authors>Hobbit</authors>
<description>Netcat is a networking utility for reading from and writing to network connections using TCP or UDP.</description>
<dependencies>
<dependency id="common.vm" />
<dependency id="netcat" version="[1.12]" />
</dependencies>
</metadata>
</package>
16 changes: 16 additions & 0 deletions packages/netcat.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
$ErrorActionPreference = 'Stop'
Import-Module vm.common -Force -DisableNameChecking

try {
$toolName = 'nc'
$category = 'Networking'
$shimPath = '%ProgramData%\chocolatey\bin\nc.exe'

$shortcutDir = Join-Path ${Env:TOOL_LIST_DIR} $category
$shortcut = Join-Path $shortcutDir "$toolName.lnk"
$executablePath = Join-Path ${Env:ChocolateyInstall} $shimPath -Resolve
Install-ChocolateyShortcut -shortcutFilePath $shortcut -targetPath $executablePath -RunAsAdmin
VM-Assert-Path $shortcut
} catch {
VM-Write-Log-Exception $_
}
7 changes: 7 additions & 0 deletions packages/netcat.vm/tools/chocolateyuninstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
$ErrorActionPreference = 'Continue'
Import-Module vm.common -Force -DisableNameChecking

$toolName = 'nc'
$category = 'Networking'

VM-Remove-Tool-Shortcut $toolName $category

0 comments on commit 84168ff

Please sign in to comment.