[Windows 2019] Fix missing msvcr100.dll (#1427)

* install vcredist2010

* Microsoft Visual C++ docs section
This commit is contained in:
Aleksandr Chebotov
2020-08-19 10:32:35 +03:00
committed by GitHub
parent 2602d38877
commit 9110b38999
3 changed files with 27 additions and 0 deletions

View File

@@ -119,6 +119,11 @@ if (Test-IsWin16) {
Choco-Install -PackageName vcredist140
}
if (Test-IsWin19) {
# Install vcredist2010
Choco-Install -PackageName vcredist2010
}
# Expand disk size of OS drive
New-Item -Path d:\ -Name cmds.txt -ItemType File -Force
Add-Content -Path d:\cmds.txt "SELECT VOLUME=C`r`nEXTEND"

View File

@@ -173,6 +173,11 @@ $markdown += New-MDNewLine
$markdown += ((Get-VisualStudioComponents) + (Get-VisualStudioExtensions)) | New-MDTable
$markdown += New-MDNewLine
$markdown += New-MDHeader "Microsoft Visual C++:" -Level 4
$markdown += New-MDNewLine
$markdown += Get-VisualCPPComponents | New-MDTable
$markdown += New-MDNewLine
$markdown += New-MDHeader ".NET Core SDK" -Level 3
$sdk = Get-DotnetSdks
$markdown += "``Location $($sdk.Path)``"

View File

@@ -224,3 +224,20 @@ function Get-NewmanVersion {
function Get-GHVersion {
return "GitHub CLI $(gh --version)"
}
function Get-VisualCPPComponents {
$vcpp = Get-CimInstance -ClassName Win32_Product -Filter "Name LIKE 'Microsoft Visual C++%'"
$vcpp | Sort-Object Name, Version | ForEach-Object {
$isMatch = $_.Name -match "^(?<Name>Microsoft Visual C\+\+ \d{4})\s+(?<Arch>\w{3})\s+(?<Ext>.+)\s+-"
if ($isMatch) {
$name = '{0} {1}' -f $matches["Name"], $matches["Ext"]
$arch = $matches["Arch"].ToLower()
$version = $_.Version
[PSCustomObject]@{
Name = $name
Architecture = $arch
Version = $version
}
}
}
}