param( $Action, [hashtable] $Arguments ) . "$PSScriptRoot/Manage.ps1"; . "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; $parameters = Get-TMForeverInstallerComponents ` -IconName "TmUnitedForever" ` -UserDirectory "$HOME/Documents/TrackMania" ` -Installer { $file = "TmUnitedForever.exe"; $dir = New-TemporaryDirectory; $null = Push-Location $dir; Write-Host "Downloading TrackMania United Forever…"; Invoke-WebRequest "http://files.trackmaniaforever.com/tmunitedforever_setup.exe" -OutFile "$file"; Write-Host "Starting installation…"; Start-Process -Wait -FilePath "$file" -ArgumentList "/Silent"; $null = Pop-Location; Remove-Item -Recurse $dir; }; foreach ($key in $PSBoundParameters.Keys) { $parameters.Add($key, $PSBoundParameters[$key]); } Start-SoftwareInstaller @parameters;