ZabbixAgent2Installer/Public/Expand-ZabbixAgentPackage.ps1
2025-09-18 03:03:12 +00:00

25 lines
509 B
PowerShell

function Expand-ZabbixAgentPackage {
param (
# Path to the .zip of the agent
[string]
$PackagePath = 'ZabbixAgent2.zip'
)
$tempExtractPath = Join-Path $env:TEMP ZabbixAgent2
'Extracted package path: {0}'-f $tempExtractPath | Write-Verbose
try {
New-Item -ItemType Directory -Path $tempExtractPath
Expand-Archive -Path $PackagePath -DestinationPath $tempExtractPath -Force
gi $tempExtractPath
}
catch {
$_
}
}