MCPcopy Index your code
hub / github.com/PowerShell/vscode-powershell / isLoginShell

Method isLoginShell

src/process.ts:242–259  ·  view source on GitHub ↗
(pwshPath: string)

Source from the content-addressed store, hash-verified

240 }
241
242 private isLoginShell(pwshPath: string): boolean {
243 try {
244 // We can't know what version of PowerShell we have without running it
245 // So we try to start PowerShell with -Login
246 // If it exits successfully, we return true
247 // If it exits unsuccessfully, node throws, we catch, and return false
248 cp.execFileSync(pwshPath, [
249 "-Login",
250 "-NoProfile",
251 "-NoLogo",
252 "-Command",
253 "exit 0",
254 ]);
255 } catch {
256 return false;
257 }
258 return true;
259 }
260
261 private async readSessionFile(
262 sessionFilePath: vscode.Uri,

Callers 1

startMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected