Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/features/CodeActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class CodeActionsFeature implements vscode.Disposable {

private async showRuleDocumentation(ruleId: string): Promise<void> {
const pssaDocBaseURL =
"https://docs.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/";
"https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/";

if (!ruleId) {
this.log.writeWarning(
Expand Down
15 changes: 0 additions & 15 deletions src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -755,21 +755,6 @@ export class PowerShellExeFinder {
}
}

export function getWindowsSystemPowerShellPath(
systemFolderName: string,
): string | undefined {
if (process.env.windir === undefined) {
return undefined;
} else
return path.join(
process.env.windir,
systemFolderName,
"WindowsPowerShell",
"v1.0",
"powershell.exe",
);
}

interface IPossiblePowerShellExe extends IPowerShellExeDetails {
exists(): Promise<boolean>;
readonly suppressWarning: boolean;
Expand Down
12 changes: 9 additions & 3 deletions src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,16 @@ export class SessionManager implements Middleware {
const fs = vscode.workspace.fs;
const pid = (await pwshProcess.getPid())!.toString();
await fs.writeFile(pidFilePath, Buffer.from(pid));
const deletePidOnExit = pwshProcess.onExited(() => {
const deletePidOnExit = pwshProcess.onExited(async () => {
deletePidOnExit.dispose();
fs.delete(pidFilePath, { useTrash: false });
console.log(`Deleted PID file: ${pidFilePath}`);
try {
await fs.delete(pidFilePath, { useTrash: false });
this.logger.writeDebug(`Deleted PID file: ${pidFilePath}`);
} catch (err) {
this.logger.writeError(
`Error occurred while deleting PID file:\n${err}`,
);
}
});
Comment thread
andyleejordan marked this conversation as resolved.
this.registeredCommands.push(deletePidOnExit);
this.extensionContext.subscriptions.push(deletePidOnExit);
Expand Down
5 changes: 0 additions & 5 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,6 @@ export async function readDirectory(
return items.map(([name, _type]) => name);
}

export function getTimestampString(): string {
const time = new Date();
return `[${time.getHours()}:${time.getMinutes()}:${time.getSeconds()}]`;
}

export function sleep(ms: number): Promise<void> {
return new Promise((resolve) => setTimeout(resolve, ms));
}
Expand Down
Loading