Last active
August 5, 2018 21:15
-
-
Save whiskerz007/82fd5611e849145d169835d32b45b4e1 to your computer and use it in GitHub Desktop.
Revisions
-
whiskerz007 revised this gist
Dec 23, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ function Start-MCLauncher Start-Process ${env:ProgramFiles(x86)}\Minecraft\MinecraftLauncher.exe -Wait True } Write-Host "`n`nAfter Minecraft Launcher starts and fully authenticates, close it." Write-Host "Starting Minecraft Launcher for initial authentication..." Start-MCLauncher -
whiskerz007 revised this gist
Dec 23, 2016 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,6 +10,7 @@ function Start-MCLauncher Start-Process ${env:ProgramFiles(x86)}\Minecraft\MinecraftLauncher.exe -Wait True } Write-Host "`n`nAfter Minecraft Launcher starts and fully authenticates, close the Minecraft Launcher." Write-Host "Starting Minecraft Launcher for initial authentication..." Start-MCLauncher @@ -22,5 +23,5 @@ Out-MCLauncherProfiles $MCNewDisplayName Write-Host "Starting Minecraft Launcher with new displayName..." Start-MCLauncher Write-Host "Restoring original Minecraft displayName to '$MCOldDisplayName'..." Out-MCLauncherProfiles $MCOldDisplayName -
whiskerz007 created this gist
Dec 23, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ $MCNewDisplayName = Read-Host -Prompt 'Enter the displayName you want to use with Minecraft' $MCLauncherPath = "${env:APPDATA}\.minecraft\launcher_profiles.json" function Out-MCLauncherProfiles ([string]$displayName) { $MCProfiles.authenticationDatabase.$MCUser.displayName = $displayName $MCProfiles | ConvertTo-Json | Out-File $MCLauncherPath -Encoding ascii } function Start-MCLauncher { Start-Process ${env:ProgramFiles(x86)}\Minecraft\MinecraftLauncher.exe -Wait True } Write-Host "Starting Minecraft Launcher for initial authentication..." Start-MCLauncher Write-Host "Changing Minecraft displayName to '$MCNewDisplayName'..." $MCProfiles = (Get-Content -Raw -Path $MCLauncherPath | ConvertFrom-Json) $MCUser = (Select-Object -InputObject $MCProfiles.authenticationDatabase | Get-Member)[-1].Name $MCOldDisplayName = Select-Object -InputObject $MCProfiles.authenticationDatabase.$MCUser.displayName Out-MCLauncherProfiles $MCNewDisplayName Write-Host "Starting Minecraft Launcher with new displayName..." Start-MCLauncher Write-Host "Restoring original Minecraft displayName to '$MCOriginalDisplayName'..." Out-MCLauncherProfiles $MCOldDisplayName This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ 1. Save the script as the name is defined. (If you place the script on the desktop, you will not have to change link string.) 2. Create a shortcut link and apply the following string (substitute the appropriate paths where necessary). %WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe -STA -Command "&{$Module = [IO.File]::ReadAllText([Environment]::GetFolderPath("""Desktop""")+"""\Minecraft_Launcher.ps1""");Invoke-Expression $Module}"