# Better PowerShell on windows > Theme | History | KeyBinding in order to make windows powershell more comfortable and add a zsh-like theme and feature follow me: - Run powershell as an `administrator` and execute following command to `disable the execution policy`, otherwise it wont let you follow next steps - `Set-ExecutionPolicy RemoteSigned` - `Register-PSRepository -Default` # this registers the default repository for PowerShell modules, so we can install packages thats are in next steps - `Install-Module posh-git -Scope CurrentUser` - `Install-Module oh-my-posh -Scope CurrentUser` - `Install-Module -Name PSReadLine -Scope CurrentUser -Force -SkipPublisherCheck` - Now you need to create a profile to set custom settings for powershell, run the following caommand: - `notepad $PROFILE` # this would create/edit file as: "C:\Users\\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1" - Now copy the following code and past it in the notepad and save the file. - You may need to install a font that supports the emojis!, I suggest to use [Hack Nerd Font Mono](https://github.com/mh-firouzjaah/coding-fonts/blob/main/coding-fonts/Hack%20Regular%20Nerd%20Font%20Complete%20Mono.ttf) - after downloading the font and install it, right click on powershells top bar and go to properties, click on `Font` tab and select the font. ** if youre using `Windows Terminal`:** - open the app, hit `Ctrl` and `,` then click on gear button at down-left side, inside the open jason file search for `"profiles":`, now edit/add `"defaults": ` the `fontFace` so that finally sould looks: ```bash ... "profiles": { "defaults": { "fontFace": "Hack Nerd Font Mono", ... }, ... ... ``` ** Read more at: ** - - ## Profile Code: ```ps1 Import-Module posh-git Import-Module oh-my-posh Set-PoshPrompt -Theme Powerlevel10k_Classic Set-PSReadLineOption -PredictionSource History Set-PSReadlineKeyHandler -Key "Tab" -Function MenuComplete Set-PSReadlineKeyHandler -Key "UpArrow" -Function HistorySearchBackward Set-PSReadlineKeyHandler -Key "DownArrow" -Function HistorySearchForward Set-PSReadLineOption -Colors @{ InlinePrediction = '#898c5b'} Set-PSReadlineOption -HistorySearchCursorMovesToEnd Set-PSReadLineKeyHandler -Key "RightArrow" -ScriptBlock { param($key, $arg) $line = $null $cursor = $null [Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref]$line, [ref]$cursor) if ($cursor -lt $line.Length) { [Microsoft.PowerShell.PSConsoleReadLine]::ForwardChar($key, $arg) } else { [Microsoft.PowerShell.PSConsoleReadLine]::AcceptNextSuggestionWord($key, $arg) } } Set-PSReadLineKeyHandler -Key End -ScriptBlock { param($key, $arg) $line = $null $cursor = $null [Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref]$line, [ref]$cursor) if ($cursor -lt $line.Length) { [Microsoft.PowerShell.PSConsoleReadLine]::EndOfLine($key, $arg) } else { [Microsoft.PowerShell.PSConsoleReadLine]::AcceptSuggestion($key, $arg) } } ```