diff --git a/scripts/Windows/Software/TrackMania Nations Forever/Manage.ps1 b/scripts/Windows/Software/TrackMania Nations Forever/Manage.ps1 index 7d065f1c..a16e69e0 100644 --- a/scripts/Windows/Software/TrackMania Nations Forever/Manage.ps1 +++ b/scripts/Windows/Software/TrackMania Nations Forever/Manage.ps1 @@ -12,13 +12,17 @@ $null = New-Module { function Restore-TmNations([Context] $context) { $feature = "DirectPlay"; Write-Host "Restoring TrackMania Nations Forever"; - + if (-not (Get-WindowsOptionalFeature -Online -FeatureName $feature).State) { + Write-Information "Enabling the ``$feature`` feature"; Enable-WindowsOptionalFeature -Online -FeatureName $feature; } + Write-Information "Installing TrackMania Nations Forever"; winget install -e --id Nadeo.TrackManiaNationsForever; + Write-Information "Removing Desktop Icon"; Remove-Item "$env:PUBLIC\Desktop\*TmNationsForever*"; + Write-Information "Restoring Files"; $context.Restore($context.SoftwareArchive($softwareName), $path); } }