1

I have tried these two:

  • $global:GitPromptSettings.DefaultPromptAbbreviateGitDirectory = $true
  • $GitPromptSettings.DefaultPromptAbbreviateGitDirectory = $true

But neither of these changes the value globally. When I open a new instance of PowerShell, the changes are not applied there, the same for VS Code

Useful info:

  • I have PowerShell 7.2.1
  • I am using Window's Terminal app from Microsoft Store

Any suggestion gratefully received. Thanks in advance.

Curious Learner
  • 1,182
  • 1
  • 4
  • 17
  • Put them in your profile file perhaps? Try from your powershell: `notepad $PROFILE` – Lasse V. Karlsen Feb 16 '22 at 09:13
  • 1
    @LasseV.Karlsen when I run `notepad $PROFILE` I get a dialog stating -- Cannot find `path/to/the/file` Do you want to create a new file? – Curious Learner Feb 16 '22 at 09:22
  • @LasseV.Karlsen Can you show the steps for creating a profile to achieve the above goal – Curious Learner Feb 16 '22 at 09:36
  • 1
    @CuriousLearner It's just a regular script file that'll get executed on startup, there are no "special steps" needed. Just click "yes" the next time you're prompted to create the file :) – Mathias R. Jessen Feb 16 '22 at 09:55
  • How did you get posh-git enabled if you don't have a profile file? – Lasse V. Karlsen Feb 16 '22 at 10:14
  • @LasseV.Karlsen I have figured out what is happening. the posh-git profile files are in Powershell directory, but the name of the file is different than what should be according to `$PROFILE`. So, when I was doing test-profile, I was getting false. – Curious Learner Feb 16 '22 at 10:18

0 Answers0