For PowerShell 5.1, the Microsoft.PowerShell_profile.ps1 file should be located in:
C:\Users\<username>\Documents\WindowsPowerShell
PSReadLine
Hub
BellStyle
Posh-Git
Dracula-Theme-PowerShell
Figlet (with Scoop)
PowerShell 7 upgrade (Not recommended)
- The PSReadLine module contains cmdlets that let you customize the command-line editing environment in PowerShell.
- To my knowledge, PSReadLine is only available for Powershell 5.x and above. It should be shipped with PowerShell so no installation needed.
- If PSReadLine is correctly installed, the following command in PowerShell should return without error.
Import-Module PSReadLine
- If your get an error like below running the previous command, it means that PSReadLine is not installed.
Windows PowerShell
Copyright (C) 2015 Microsoft Corporation. All rights reserved.
PS C:\Windows\System32\WindowsPowerShell\v1.0> $Error
Import-Module : The specified module 'PSReadline' was not loaded because no valid module file was found in any
module directory.
+ CategoryInfo : ResourceUnavailable: (PSReadline:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
- Quick fix as stated in this StackExchange answer is to run the following command in PowerShell as an administrator (Probably works in PowerShell without high privileges too, but I haven't try).
Install-Module -Name PSReadLine
- An extension you can install from hub
- Main use is to create repo from commandline or powershell
- To avoid the bell ringing when backspacing on powershell
- Posh-Git is a PowerShell module that integrates Git and PowerShell by providing Git status summary information that can be displayed in the PowerShell prompt, e.g.:
- A PowerShell theme you can install from Dracula-PowerShell
- If you are running PowerShell 5.1 you will need to use Set-PSReadLineOption -TokenKind as below instead of Set-PSReadlineOption -Color as stated in their PowerShell Configuration
- To determine your PowerShell version use
$PSVersionTable.PSVersion
- If you get an error for using
$GitPromptSettings.DefaultPromptPrefix.Text
, it means you are running posh git v0.7.3 or previous. This setting was only introduced in v1.0.0-beta1 - If you get an error for using
$GitPromptSettings.BeforeStatus.ForegroundColor = [ConsoleColor]::Blue
, it means you are running posh git v1.0.0-beta1 or previous. This setting was only introduced in v1.0.0-beta2 - The configuration settings are only going to work with posh-git v1.0.0-beta2 and further. You should try updating with the following command.
PowerShellGet\Update-Module posh-git
- If it's not working, try updating PowerShellGet. If you can, try running the following commands from an elevated PowerShell session.
- Get the latest Nuget provider before updating PowerShellGet.
Install-PackageProvider Nuget –Force Exit
- Install the module.
Install-Module –Name PowerShellGet –Force Exit
- Get the newest possible version.
Update-Module -Name PowerShellGet Exit
- Try to update posh-git again.
If you have gone through all those steps and you still get errors, try the following commnad.PowerShellGet\Update-Module posh-git
You can find the command here - dahlbyk/posh-git#570. The only modification from the original command is the beta version which I changed fromInstall-Module posh-git -AllowPrerelease -Scope CurrentUser -RequiredVersion 1.0.0-beta2
beta1
tobeta2
.
- From Figlet : Figlet is a program that makes large letters out of ordinary text.
, _ _ __ __ _ _ _
/| | | | | | \ \ / /__ _ __| | __| | |
|___| _ | | | | __ \ \ /\ / / _ \| '__| |/ _` | |
| |\|/ |/ |/ / \_ \ V V / (_) | | | | (_| |_|
| |/|__/|__/|__/\__/ \_/\_/ \___/|_| |_|\__,_(_)
- You can install figlet from Scoop. Depending on your powershell version or desired configuration you might need some workaround to install it but the following command in PowerShell should do it :
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
# or shorter
iwr -useb get.scoop.sh | iex
- If installed correctly, the following command in PowerShell should install figlet
scoop install figlet
- If you get the following message :
fatal: unable to access 'https://github.com/lukesampson/scoop/': SSL certificate problem: self signed certificate in certificate chain
Update failed.
- you might be trying to go through a firewall. You can deactivate the sslverify in command line or PowerShell with
git config --global http.sslverify "false"
. Try to install Figlet again. Once the operation works don't forget to reactivate the sslverifygit config --global http.sslverify "true"
- If you want to upgrade to the latest version of powershell, run the following command:
iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI"
Be aware that the location of the profile has changed to avoid conflicts with other powershell versions:
C:\Users\<user>\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
- For more info, check Migrating from Windows PowerShell 5.1 to PowerShell 7
You will need to install Posh-Git
again via PowerShell 7: Install-Module -Name posh-git -AllowPrerelease -Force
.
Finally, you will need to update the Microsoft.PowerShell_profile.ps1
.
One of the problems I found was that PowerShell 7 doesn't allow me to change properties. See this r/PowerShell question. The proposed fix worked but I found it was better (for me) to just execute the existing shortcut with admin rights always by default (change properties of shortcut).
- As a side note, the
hub
command seems to be broken. This is true for all versions of PowerShell. There is maybe a problem with thehub.ps1
file:
~ $ hub
&: C:\Users\<user>\scoop\shims\hub.ps1:3
Line |
3 | ... on.expectingInput) { $input | & $path @args } else { & $path @args ...
|
| The term
| 'C:\Users\<user>\scoop\shims\..\apps\hub\current\bin\hub.exe'
| is not recognized as the name of a cmdlet, function, script
| file, or operable program. Check the spelling of the name, or
| if a path was included, verify that the path is correct and
| try again.
Will try to get a clean install to confirm problem.
Hi. Is
figlet
available to Win32 systems? I can't find where.