$ErrorActionPreference = "Stop";
trap { $host.SetShouldExit(1) }

$BOSH_INSTALL_TARGET = Resolve-Path $env:BOSH_INSTALL_TARGET
$path=(Get-ChildItem "EventLogForwarder/EventLogForwarder*.zip").FullName
if (Get-Command Expand-Archive -ErrorAction SilentlyContinue) {
    Expand-Archive -Path $path -DestinationPath ${BOSH_INSTALL_TARGET}
} else {
    Add-Type -AssemblyName System.IO.Compression.FileSystem
    [System.IO.Compression.ZipFile]::ExtractToDirectory($path, ${BOSH_INSTALL_TARGET})
}
