MCPcopy
hub / github.com/PowerShell/vscode-powershell / getVersionDetails

Method getVersionDetails

src/session.ts:1112–1133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1110 }
1111
1112 private async getVersionDetails(): Promise<
1113 IPowerShellVersionDetails | undefined
1114 > {
1115 // Take one minute to get version details, otherwise cancel and fail.
1116 const timeout = new vscode.CancellationTokenSource();
1117 setTimeout(() => {
1118 timeout.cancel();
1119 }, 60 * 1000);
1120
1121 const versionDetails = await this.languageClient?.sendRequest(
1122 PowerShellVersionRequestType,
1123 timeout.token,
1124 );
1125
1126 // This is pretty much the only telemetry event we care about.
1127 // TODO: We actually could send this earlier from PSES itself.
1128 this.sendTelemetryEvent("powershellVersionCheck", {
1129 powershellVersion: versionDetails?.version ?? "unknown",
1130 });
1131
1132 return versionDetails;
1133 }
1134
1135 private async promptForRestart(): Promise<void> {
1136 await this.logger.writeAndShowErrorWithActions(

Callers 1

startMethod · 0.95

Calls 1

sendTelemetryEventMethod · 0.95

Tested by

no test coverage detected