A previous SO answer by @gino-mempin described how to query the SQLite tables in the state.vscdb files that contain the extension states using the SQLite browser. To query the vscdb programmatically using PowerShell, please see another SO answer here about querying for cookies.
Recall that the global settings.json file location by operating system is
- Windows
%APPDATA%\Code\User\settings.json or $env:APPDATA\Code\User\settings.json
- macOS
$HOME/Library/Application\ Support/Code/User/settings.json
- Linux
$HOME/.config/Code/User/settings.json
I use an asterisk * after Code to account for possible the Code - Insiders construction of the Insiders build, if you're on the Insiders channel. For global settings, relative to settings.json, state.vscdb is located in ./User/globalStorage/state.vscdb.
Resolve-Path "$env:APPDATA\Code*\User\globalStorage\state.vscdb" # global settings store for extensions
For workspace specific settings, again relative to the settings.json, state.vscdb per workspace is stored in ./User/workspaceStorage/<ExtensionContext.storageUri>/state.vscdb
Again, for example, PowerShell in Windows:
Resolve-Path "$env:APPDATA\Code*\User\workspaceStorage\*\state.vscdb" # workspace settings store for extensions
The ExtensionContext.storageUri refers to the uri of a workspace specific directory in which the extension can store private state. This can be found using the Developer Tools (Help > Toggle Developer Tools)

Then, in the console, type
let config = await vscode.context.resolveConfiguration();
config.workspace;
Here is a screen recording of this process:

See the VS Code API docs for more information on the ExtensionContext.storageUri within the context of extension development.