mirror of
https://github.com/actions/runner-images.git
synced 2025-12-19 08:22:12 +00:00
[Windows][Improvement] Split and simplify "InitializeVM.ps1" script (#3806)
* improve InitializeVM script * Update windows2019.json * remove configs * resolve comments * resolve comments; fix order * fix templates
This commit is contained in:
24
images/win/scripts/Installers/Install-WindowsFeatures.ps1
Normal file
24
images/win/scripts/Installers/Install-WindowsFeatures.ps1
Normal file
@@ -0,0 +1,24 @@
|
||||
# Install .NET Framework 3.5 (required by Chocolatey)
|
||||
# Explicitly install all 4.7 sub features to include ASP.Net.
|
||||
# As of 1/16/2019, WinServer 19 lists .Net 4.7 as NET-Framework-45-Features
|
||||
Install-WindowsFeature -Name NET-Framework-Features -IncludeAllSubFeature
|
||||
Install-WindowsFeature -Name NET-Framework-45-Features -IncludeAllSubFeature
|
||||
|
||||
if (Test-IsWin16) {
|
||||
Install-WindowsFeature -Name BITS -IncludeAllSubFeature
|
||||
Install-WindowsFeature -Name DSC-Service
|
||||
}
|
||||
|
||||
# Install FS-iSCSITarget-Server
|
||||
$fsResult = Install-WindowsFeature -Name FS-iSCSITarget-Server -IncludeAllSubFeature -IncludeManagementTools
|
||||
if ( $fsResult.Success ) {
|
||||
Write-Host "FS-iSCSITarget-Server has been successfully installed"
|
||||
} else {
|
||||
Write-Host "Failed to install FS-iSCSITarget-Server"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "Install Containers feature"
|
||||
Install-WindowsFeature -Name Containers
|
||||
|
||||
Invoke-PesterTests -TestFile "WindowsFeatures" -TestName "ContainersFeature"
|
||||
Reference in New Issue
Block a user