2019-12-13 09:48:00 -05:00
|
|
|
################################################################################
|
|
|
|
|
## File: Install-CloudFoundryCli.ps1
|
|
|
|
|
## Desc: Install Cloud Foundry CLI
|
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
|
|
# Download the latest cf cli exe
|
2023-12-11 22:23:36 +01:00
|
|
|
$cloudFoundryCliUrl = "https://packages.cloudfoundry.org/stable?release=windows64-exe&source=github"
|
2020-05-05 20:49:34 +03:00
|
|
|
|
2023-12-11 22:23:36 +01:00
|
|
|
$cloudFoundryArchPath = Invoke-DownloadWithRetry $cloudFoundryCliUrl
|
2019-12-13 09:48:00 -05:00
|
|
|
|
|
|
|
|
# Create directory for cf cli
|
2023-12-11 22:23:36 +01:00
|
|
|
$cloudFoundryCliPath = "C:\cf-cli"
|
|
|
|
|
New-Item -Path $cloudFoundryCliPath -ItemType Directory -Force
|
2019-12-13 09:48:00 -05:00
|
|
|
|
|
|
|
|
# Extract the zip archive
|
|
|
|
|
Write-Host "Extracting cf cli..."
|
2023-12-11 22:23:36 +01:00
|
|
|
Expand-7ZipArchive -Path $cloudFoundryArchPath -DestinationPath $cloudFoundryCliPath
|
2019-12-13 09:48:00 -05:00
|
|
|
|
|
|
|
|
# Add cf to path
|
2023-12-11 22:23:36 +01:00
|
|
|
Add-MachinePathItem $cloudFoundryCliPath
|
2020-07-10 14:29:54 +03:00
|
|
|
|
2023-10-11 11:02:59 +02:00
|
|
|
# Validate cf signature
|
2024-06-28 14:44:37 +05:30
|
|
|
$cloudFoundrySignatureThumbprint = "2C6B2F1562698503A6E4A25F2DF058E12E23A190"
|
2023-12-11 22:23:36 +01:00
|
|
|
Test-FileSignature -Path "$cloudFoundryCliPath\cf.exe" -ExpectedThumbprint $cloudFoundrySignatureThumbprint
|
2023-10-11 11:02:59 +02:00
|
|
|
|
|
|
|
|
Invoke-PesterTests -TestFile "CLI.Tools" -TestName "CloudFoundry CLI"
|