Files
runner-images/images/win/scripts/Installers/Validate-Rust.ps1
Jostein Kjønigsen c0df07efc8 Fix formatting in doc-string for Rust for Windows-image.
Ensure output in ` images/win/Windows2019-Readme.md` looks proper.

[Live in master right now](https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md#rust-64-bit), it looks kinda bad.
2020-04-27 19:32:00 +02:00

35 lines
1.0 KiB
PowerShell

################################################################################
## File: Validate-Rust.ps1
## Desc: Verify that Rust is on the path and output version information.
################################################################################
if (Get-Command -Name 'rustc')
{
Push-Location -Path $env:UserProfile
New-Item -Name ".rustup" -Value "C:\Rust\.rustup" -ItemType Junction
New-Item -Name ".cargo" -Value "C:\Rust\.cargo" -ItemType Junction
$RustcVersion = rustc --version
Write-Host "$RustcVersion is on the path"
Pop-Location
}
else
{
Write-Host "rustc is not on the path"
exit 1
}
$RustPath = Split-Path (Get-Command -Name 'rustc').Path
$RustcVersion -Match "\d+\.\d+\.\d+" | Out-Null
$Version = $Matches[0]
# Adding description of the software to Markdown
$SoftwareName = "Rust (64-bit)"
$Description = @"
#### $Version
_Environment:_
* _Location:_ $RustPath
* PATH: contains the location of rustc.exe
"@
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description