$DocumentsPath = [Environment]::GetFolderPath("MyDocuments")
$uri = New-Object System.Uri($ServerAddress)
$Server = $uri.Host
$configpath = "$env:userprofile\Documents\Pyro Studios\Commandos\OUTPUT\COMANDO.CFG"
Copy-Item -Path "$InstallDirectory\Pyro Studios" -Destination "$DocumentsPath" -Recurse
Write-ReplaceContentInFile -Pattern '^.SERVERADDRESS (.+)' -Substitution ".SERVERADDRESS $Server" -FilePath "$configpath"
Rename-Item -Path "$InstallDirectory\VIDEO\H_Intro.avi" -NewName "$InstallDirectory\VIDEO\H_Intro.bak"
$DocumentsPath = [Environment]::GetFolderPath("MyDocuments")
Remove-Item -Path "$DocumentsPath\Pyro Studios" -Recurse -force
$configpath1 = "$env:userprofile\Documents\Pyro Studios\Commandos\OUTPUT\COMANDO.CFG"
# Use regex to replace text within a file. Quotes are escaped by double quoting ("")
Write-ReplaceContentInFile -Pattern '^.NETGAMEPLAYER (.+)' -Substitution ".NETGAMEPLAYER $NewPlayerAlias" -FilePath "$configPath1"