mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +00:00
* Apply code style rules to Windows scripts * Fix typo * Fix configure-toolset script * Fix parameters in Msys2 installation script * Improve log readability * Remove broken exit code validation
27 lines
1.0 KiB
PowerShell
27 lines
1.0 KiB
PowerShell
################################################################################
|
|
## File: Install-CloudFoundryCli.ps1
|
|
## Desc: Install Cloud Foundry CLI
|
|
################################################################################
|
|
|
|
# Download the latest cf cli exe
|
|
$cloudFoundryCliUrl = "https://packages.cloudfoundry.org/stable?release=windows64-exe&source=github"
|
|
|
|
$cloudFoundryArchPath = Invoke-DownloadWithRetry $cloudFoundryCliUrl
|
|
|
|
# Create directory for cf cli
|
|
$cloudFoundryCliPath = "C:\cf-cli"
|
|
New-Item -Path $cloudFoundryCliPath -ItemType Directory -Force
|
|
|
|
# Extract the zip archive
|
|
Write-Host "Extracting cf cli..."
|
|
Expand-7ZipArchive -Path $cloudFoundryArchPath -DestinationPath $cloudFoundryCliPath
|
|
|
|
# Add cf to path
|
|
Add-MachinePathItem $cloudFoundryCliPath
|
|
|
|
# Validate cf signature
|
|
$cloudFoundrySignatureThumbprint = "4C69EDD13930ED01B83DD1D17B09C434DC1F2177"
|
|
Test-FileSignature -Path "$cloudFoundryCliPath\cf.exe" -ExpectedThumbprint $cloudFoundrySignatureThumbprint
|
|
|
|
Invoke-PesterTests -TestFile "CLI.Tools" -TestName "CloudFoundry CLI"
|