mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
[Windows] Implement new directories hierarchy (#8616)
This commit is contained in:
committed by
GitHub
parent
84a7deae24
commit
d1f2c9a3be
30
images/windows/scripts/build/Install-WindowsFeatures.ps1
Normal file
30
images/windows/scripts/build/Install-WindowsFeatures.ps1
Normal file
@@ -0,0 +1,30 @@
|
||||
$windowsFeatures = (Get-ToolsetContent).windowsFeatures
|
||||
|
||||
foreach ($feature in $windowsFeatures) {
|
||||
if ($feature.optionalFeature) {
|
||||
Write-Host "Activating Windows Optional Feature '$($feature.name)'..."
|
||||
Enable-WindowsOptionalFeature -Online -FeatureName $feature.name -NoRestart
|
||||
|
||||
$resultSuccess = $?
|
||||
} else {
|
||||
Write-Host "Activating Windows Feature '$($feature.name)'..."
|
||||
$Arguments = @{
|
||||
Name = $feature.name
|
||||
IncludeAllSubFeature = [System.Convert]::ToBoolean($feature.includeAllSubFeatures)
|
||||
IncludeManagementTools = [System.Convert]::ToBoolean($feature.includeManagementTools)
|
||||
}
|
||||
$result = Install-WindowsFeature @Arguments
|
||||
|
||||
$resultSuccess = $result.Success
|
||||
}
|
||||
|
||||
if ($resultSuccess) {
|
||||
Write-Host "Windows Feature '$($feature.name)' was activated successfully"
|
||||
} else {
|
||||
throw "Failed to activate Windows Feature '$($feature.name)'"
|
||||
}
|
||||
}
|
||||
|
||||
# it improves Android emulator launch on Windows Server
|
||||
# https://learn.microsoft.com/en-us/windows-server/virtualization/hyper-v/manage/manage-hyper-v-scheduler-types
|
||||
bcdedit /set hypervisorschedulertype root
|
||||
Reference in New Issue
Block a user