I completely uninstalled Visual Studio Code but this VSCode extension script getplastertemplate.ps1 keeps executing every time I open the default PowerShell console now.
After uninstalling Visual Studio Code I performed a careful manual cleanup of both the registry and the file system. However, every time I launch PowerShell.exe or PowerShell_ISE.exe, my security software is blocking getplastertemplate.ps1:
03/26/18 04:44:12 Prevented process from launching from <c:\users\.vscode\extensions\ms-vscode.powershell-1.6.0\modules\plaster>.
This directory does not exist in the file system: c:\users\.vscode\extensions\ms-vscode.powershell-1.6.0\modules\plaster
How can I reset PowerShell.exe to the way it was prior to installing Visual Studio Code ?
Sounds like it’s in your PowerShell profile script. Take a look in your docs/PowerShell and there should be a profile.ps1 (This is from the top of my head btw)
I checked. My profile is empty.
I know you said you checked your powershell profile, but there are several. If you have looked at those, my apologies. If not, I think it’s worth a look:
Each of the profiles are empty.
So, aside for the profile scripts, PowerShell doesn’t have any way of auto-executing scripts. It might be worth searching your system for the script in question, and renaming it to something else. That way, whatever is attempting to launch it may throw an error that would be more helpful.
Don I didn’t see your reply but I did just that. I found that ModuleAnalysisCache located in C:\Users\AppData\Local\Microsoft\Windows\PowerShell was the culprit. I searched for getplastertemplate.ps1 and it was in there. As to why it was getting executed - being an empty, non-executable script - when launching the default console, I leave that explanation to you.
In any case, deleting ModuleAnalysisCache solved the problem.