github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/e2e/terraform/packer/windows/install-nomad.ps1 (about)

     1  Set-StrictMode -Version latest
     2  $ErrorActionPreference = "Stop"
     3  
     4  # Force TLS1.2
     5  [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
     6  
     7  Set-Location C:\opt
     8  
     9  Try {
    10      # we install the most recent stable/GA release; this will be replaced
    11      # with the current master when we run e2e tests
    12      $releases = "https://releases.hashicorp.com"
    13      $version = "0.9.6"
    14      $url = "${releases}/nomad/${version}/nomad_${version}_windows_amd64.zip"
    15  
    16      $configDir = "C:\opt\nomad.d"
    17      md $configDir
    18      md C:\opt\nomad
    19  
    20      # TODO: check sha!
    21      Write-Output "Downloading Nomad from: $url"
    22      Invoke-WebRequest -Uri $url -Outfile nomad.zip
    23      Expand-Archive .\nomad.zip .\
    24      mv nomad.exe C:\opt\nomad.exe
    25      C:\opt\nomad.exe version
    26      rm nomad.zip
    27  
    28  } Catch {
    29      Write-Error "Failed to install Nomad."
    30      $host.SetShouldExit(-1)
    31      throw
    32  }
    33  
    34  Write-Output "Installed Nomad."