poshcodebear / PSSuperPrompt

Some cool extra tricks for your PowerShell prompt to display more details and colors
MIT License
1 stars 1 forks source link

May not work from an "administrator" powershell prompt in windows terminal #4

Closed tildesarecool closed 7 months ago

tildesarecool commented 7 months ago

Not sure if this is how it's supposed to run but When i tested in the "special" PowerShell prompt provided by VS Code the script seemed to work (the prompt changed, it had different font colors, etc) but when I tried to run from an administrator level Windows Terminal with PowerShell it changed the prompt to PS> and no coloring or version information etc.

I don't run VSCode as admin so it could be related to check for admin level code?

super-prompt-screenshot

tildesarecool commented 7 months ago

Upon further reflection I realize I don't have posh-git installed which I think PSSuperPrompt requires. so it should probably have dumped out when that check failed.

tildesarecool commented 7 months ago

I think I sort of figured out why the script seems to run via PS in VSCode but not in admin shell PS. I think it's related to git not being defined by an environment variable. The git integration into VSCode must be related. It's just picking up regular old git.exe some how. Best Guess. I don't know how to fix it though (you're welcome)

poshcodebear commented 7 months ago

It works fine from an admin prompt and explicitly does not require any of the git executables to work...the part you're missing is you need to dot source the script, so instead of running

PS> .\profile.ps1

you need to run

PS> . .\profile.ps1

(the PS> is just to indicate a generic prompt, don't type that part)

Going ahead and closing this, but if you have questions about this feel free to comment here or ping me offline