Update PowerShell snippets

This commit is contained in:
Pat Hartl 2026-05-26 20:37:29 -05:00
parent a67b1953f0
commit 81639e9fc2
8 changed files with 10 additions and 4 deletions

View file

@ -1,2 +0,0 @@
# Takes the variable $Filename, splits it by invalid characters, then joins using _
$Filename.Split([IO.Path]::GetInvalidFileNameChars()) -join '_'

View file

@ -1,2 +1,2 @@
# Converts a string to a UTF16-encoded byte array. This looks like ASCII characters separated by 0x00 in most cases.
$bytes = ConvertTo-StringBytes -Input "Hello World!" -Utf16 1 -MaxLength 12
$bytes = ConvertTo-StringBytes -Input "Hello World!" -Utf16 $true -MaxLength 12

View file

@ -0,0 +1,2 @@
# Patches GameSpy master server references to OpenSpy in game binaries and config files
Edit-PatchGameSpy -Path $InstallDirectory

View file

@ -1 +1 @@
$manifest = Get-GameManifest "C:\Games\<Game Directory>"
$manifest = Get-GameManifest -Path $InstallDirectory -Id $GameManifest.Id

View file

@ -0,0 +1,2 @@
# Returns resolved options (defaults + per-game overrides) for a redistributable
$options = Get-RedistributableOptions -Path $InstallDirectory -Id $GameManifest.Id -Name $RedistributableManifest.Name

View file

@ -0,0 +1 @@
$sanitized = Get-SanitizedPath -Path $PlayerAlias

View file

@ -0,0 +1,2 @@
# Creates a package result for the packaging pipeline
New-Package -Path $InstallDirectory -Version "1.0.0"

View file

@ -0,0 +1 @@
Write-GameManifest -Path $InstallDirectory -Manifest $manifest