Powershell Settings
Quick Commands
- Open the current folder:
- Open the current folder in VS Code:
Git
Install git from git-scm.
SSH
Gererate ssh key by the following command:
Vim
-
Install by the following command:
-
Add vim path:
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\Vim\vim82", [EnvironmentVariableTarget]::User)
Oh My Posh
- Install by the following command:
winget install JanDeDobbeleer.OhMyPosh
-
Enable ps1 file execution:
- Check the current execution policy:
Get-ExecutionPolicy -List
- Set the execution policy for the current user:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
-
Add profile:
- Create the folder:
New-Item -ItemType Directory -Force -Path (Split-Path $PROFILE)
- Check if the profile file exists:
- Edit the profile file:
- Add the following content to the profile file:
oh-my-posh init pwsh | Invoke-Expression
# Better history & completion
Import-Module PSReadLine
Set-PSReadLineOption -PredictionSource History
PowerShell Too Old
If you get the error, it might be because your PowerShell version is too old. You can check your PowerShell version by running:
Install-Module PSReadLine -Force -Scope CurrentUser
# Check Oh My Posh version
$PSVersionTable.PSVersion