[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:
Maxim Lobanov
2021-07-29 10:46:27 +03:00
committed by GitHub
parent 7b1d76227c
commit 2e8f85a83b
12 changed files with 111 additions and 328 deletions

View 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"