Tune your Terminal with a PowerShell profile
With the new Windows Terminal available I’ve been searching on how to upgrade my console experience. I see a lot of people improving their terminal to show important information, like which Git branch you are working on, which Azure subscription, the actual location on disk, etc.
A couple of months ago I came across Brad Wilson his post on the matter and I like the way his terminal looks. His post, is rather straightforward, but there was some information missing. Well, ‘missing’ isn’t the correct word. In his post he has assumed some prerequisites which I hadn’t set up on my machine(s).
For reference sake, I’ll repeat some steps over here from Brad his post and add some of myself which were unclear to me.
First of all, you need to install posh-git. This is a small PowerShell module which integrates Git in PowerShell. It’s very useful and now that I know of it I advise everyone to use it!
I did have some versioning issues when installing this though. The first time when I ran the command PS> install-module posh-git I got the following message(s).
PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGet provider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or 'C:\Users\jan\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider by running 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install and import the NuGet provider now?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y
Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from 'PSGallery'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"):
Eventually, I was able to get this to work, but I had to update my PowerShellGet repository first. As you can see from the script below, this also failed.


