3D Ultra Minigolf

From LANCommander
Revision as of 06:52, 31 July 2023 by DoctorDalek (talk | contribs) (Created page with "Category:Games {{Game.InfoBox |Cover = cover.jpg |Release Date = {{Game.InfoBox.ReleaseDate|Windows|December 31, 1997}} | PCGamingWiki = 3D_Ultra_Minigolf_Adventures }} {{Game.ActionBox |Actions = {{Game.ActionBox.Row|Name = Play|Path = minigolf.exe|Arguments = |WorkingDirectory = |Primary = True}} }} {{Game.Scripts.NameChange |Name = Name Change Script |Description = |RequiresAdmin = False |Contents = <syntaxhighlight lang="powershell" line> $InstallDir = $PSScr...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Release Date
Windows: December 31, 1997
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play minigolf.exe True

Name Change Script

$InstallDir = $PSScriptRoot
$NewName = $args[0]

function Write-ReplaceContentInFile([string]$Regex, [string]$Replacement, [string]$FilePath)
{
    $content = (Get-Content $FilePath) -replace $Regex, $Replacement
    [IO.File]::WriteAllLines($FilePath, $content)
}

# Use regex to replace text within a file. Quotes are escaped by double quoting ("")
Write-ReplaceContentInFile -Regex '^Player1Name=(.+)' -Replacement "Player1Name=$NewName" -FilePath "$InstallDir\minigolf.ini"