From 854839edcf3f66c7464e134914122fb43469d159 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 2 Jul 2023 19:00:25 +0200 Subject: [PATCH] Activate features if not enabled --- scripts/Windows/Software/TrackMania Nations Forever/Manage.ps1 | 2 +- scripts/Windows/Software/TrackMania United Forever/Manage.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Windows/Software/TrackMania Nations Forever/Manage.ps1 b/scripts/Windows/Software/TrackMania Nations Forever/Manage.ps1 index a8dc0dfa..c8d0de24 100644 --- a/scripts/Windows/Software/TrackMania Nations Forever/Manage.ps1 +++ b/scripts/Windows/Software/TrackMania Nations Forever/Manage.ps1 @@ -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; } diff --git a/scripts/Windows/Software/TrackMania United Forever/Manage.ps1 b/scripts/Windows/Software/TrackMania United Forever/Manage.ps1 index e9a29b55..51378236 100644 --- a/scripts/Windows/Software/TrackMania United Forever/Manage.ps1 +++ b/scripts/Windows/Software/TrackMania United Forever/Manage.ps1 @@ -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; }