Skip to content

Commit 1c2391e

Browse files
committed
Added remove Minecraft related creds.
1 parent a970450 commit 1c2391e

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Modules/Remove-XboxCredentials.psm1

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
@{
1+
# TODO: Clean up the code no need for two for-loops.
2+
@{
23
ModuleName = 'Remove-XboxCredentials'
34
ModuleVersion = '1.0.0'
45
Author = 'Tyler Jaacks'
@@ -22,6 +23,19 @@ function Remove-XboxCredentials {
2223

2324
Write-Output "Removed: $credName"
2425
}
26+
27+
$CredsToRemove = $Creds -Match "MCLMS\|.*"
28+
29+
# Remove each matching credential
30+
foreach ($Cred in $CredsToRemove) {
31+
# Extract the exact credential name
32+
$CredName = $Cred -Replace ".*Target: ", ""
33+
34+
# Remove the credential
35+
cmdkey /delete:$CredName
36+
37+
Write-Output "Removed: $credName"
38+
}
2539
}
2640

2741
# Export the function to be available to users of the module

0 commit comments

Comments
 (0)