Skip to content

Instantly share code, notes, and snippets.

@ypcode
Created February 8, 2019 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ypcode/039fc6f32b0b48e20e6cfd9e5610666f to your computer and use it in GitHub Desktop.
Save ypcode/039fc6f32b0b48e20e6cfd9e5610666f to your computer and use it in GitHub Desktop.
param(
[string]$UserDataDir="C:\\Workspace\\chrome\\dev_user_dir"
)
$localStateJson = Get-Content "$UserDataDir\\Local State"
$localState = $localStateJson | ConvertFrom-Json
$profileKeys = $localState.profile.info_cache | Get-Member | ? {$_.MemberType -eq "NoteProperty"}
$infoCache = $localState.profile.info_cache
$allEntries = @()
ForEach($key in $profileKeys) {
$profile = $key.Name
$profileDisplayName = $infoCache."$profile".name
$newEntry = @{
Profile=$profile;
Name=$profileDisplayName;
};
$allEntries += $newEntry
}
$allEntries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment