feat(firstOpenProject): be based on os and shell version to provide different commands that open project in remote env

This commit is contained in:
Levi Yan
2025-06-16 23:05:01 +08:00
parent b36feb764b
commit f0973280f4
5 changed files with 48 additions and 7 deletions

View File

@@ -116,4 +116,20 @@ export async function showErrorNotification(message: string): Promise<void> {
} else if (selection === 'Report a problem') {
vscode.commands.executeCommand('vscode.open', vscode.Uri.parse('https://gitee.com/SuperIDE/DevStar/issues'));
}
}
export async function powershellVersion(): Promise<string> {
return new Promise((resolve, reject) => {
exec('powershell -Command "$PSVersionTable.PSVersion.ToString()"', (error, stdout, stderr) => {
if (error) {
reject(`Error executing PowerShell command: ${error.message}`);
return;
}
if (stderr) {
reject(`PowerShell command returned an error: ${stderr}`);
return;
}
resolve(stdout.trim());
});
});
}