Activate features if not enabled

This commit is contained in:
Manuel Thalmann 2023-07-02 19:00:25 +02:00
parent e38ae40c8e
commit 854839edcf
2 changed files with 2 additions and 2 deletions

View file

@ -14,7 +14,7 @@ $null = New-Module {
Write-Host "Restoring TrackMania Nations Forever";
foreach ($feature in $features) {
if (-not (Get-WindowsOptionalFeature -Online -FeatureName $feature).State) {
if ((Get-WindowsOptionalFeature -Online -FeatureName $feature).State -ne "Enabled") {
Write-Information "Enabling the ``$feature`` feature";
Enable-WindowsOptionalFeature -Online -All -FeatureName $feature;
}

View file

@ -14,7 +14,7 @@ $null = New-Module {
Write-Host "Restoring TrackMania United Forever";
foreach ($feature in $features) {
if (-not (Get-WindowsOptionalFeature -Online -FeatureName $feature).State) {
if ((Get-WindowsOptionalFeature -Online -FeatureName $feature).State -ne "Enabled") {
Write-Information "Enabling the ``$feature`` feature";
Enable-WindowsOptionalFeature -Online -All -FeatureName $feature;
}