Last active
June 29, 2025 14:53
-
-
Save NicmeisteR/55eb23a702e88d746a818f3b5c2943d6 to your computer and use it in GitHub Desktop.
Halo Infinite Login Fix
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 characters
# Define the specific credential prefix to delete | |
$CredentialPrefix = 'Xbl|2043073184' | |
# Get raw output directly as string array | |
$rawOutput = & cmdkey.exe /list | Out-String -Stream | |
# Show what we're looking for | |
Write-Host "Looking for credentials starting with: '$CredentialPrefix'" -ForegroundColor Yellow | |
# Better parsing of cmdkey output with more flexible pattern matching | |
$Credentials = @() | |
foreach ($line in $rawOutput) { | |
# Try multiple patterns to ensure we catch the credentials | |
if ($line -match "Target:\s*(.+)$" -or $line -match "^(Xbl\|[^\s]+)") { | |
$potentialTarget = $matches[1].Trim() | |
# Check with case-insensitive comparison and more flexible matching | |
if ($potentialTarget -like "*$CredentialPrefix*") { | |
$Credentials += $potentialTarget | |
Write-Host "Found matching credential: '$potentialTarget'" -ForegroundColor Green | |
} | |
} | |
} | |
# If no credentials found, try an alternative approach | |
if ($Credentials.Count -eq 0) { | |
Write-Host "No matches found with primary method, trying alternative approach..." -ForegroundColor Yellow | |
$targetLines = $rawOutput | Select-String -Pattern "Target:" -SimpleMatch | |
foreach ($line in $targetLines) { | |
$targetText = $line.ToString() -replace ".*Target:\s*", "" | |
if ($targetText -like "*$CredentialPrefix*") { | |
$Credentials += $targetText | |
Write-Host "Found matching credential with alternative method: '$targetText'" -ForegroundColor Green | |
} | |
} | |
} | |
# Log the number of matching credentials found | |
Write-Host "Total matching credentials found: $($Credentials.Count)" -ForegroundColor Yellow | |
# Delete each matching credential | |
foreach ($Credential in $Credentials) { | |
Write-Host "Attempting to delete credential: '$Credential'" -ForegroundColor Cyan | |
try { | |
$deleteResult = cmdkey.exe /delete:$Credential | |
$deleteResult | Out-Host | |
# Double-check with explicit syntax | |
if ($deleteResult -notlike "*successfully*") { | |
Write-Host "Trying alternative delete syntax..." -ForegroundColor Yellow | |
$deleteResult = cmdkey.exe /delete:"$Credential" | |
$deleteResult | Out-Host | |
} | |
} | |
catch { | |
Write-Host "Error deleting credential: $_" -ForegroundColor Red | |
} | |
} | |
Write-Host "Deletion process complete." -ForegroundColor Green |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment