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

$BOSH_INSTALL_TARGET = Resolve-Path "${env:BOSH_INSTALL_TARGET}"

$image_name="cloudfoundry/windows2016fs"
$image_tag="2019.0.214"

c:\var\vcap\packages\hydrate\hydrate.exe download -image $image_name -tag $image_tag -noTarball -outputDir "$BOSH_INSTALL_TARGET"
if ($LastExitCode -ne 0) {
  Exit $LastExitCode
}

