25 lines
509 B
PowerShell
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 {
|
|
$_
|
|
}
|
|
|
|
|
|
}
|
|
|