DEV Community

Cover image for Best PowerShell Dev Environment on Windows
Muhammad Ridwan Hakim, S.T.
Muhammad Ridwan Hakim, S.T.

Posted on • Edited on

Best PowerShell Dev Environment on Windows

Hey everyone! 😊 I just wanted to share a bit about my development setup. I’m using a 1920x1080 display with UI scaling set to 100%, which makes my PowerShell terminal look really pretty on Windows Terminal. It’s been working great for me! So let’s get started:

1. Install PowerShell 7.4.6 (Windows x64)

Download: https://github.com/PowerShell/PowerShell/releases/download/v7.4.5/PowerShell-7.4.6-win-x64.msi

2. Open PowerShell, Install Scoop

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
Enter fullscreen mode Exit fullscreen mode

3. Install Windows Terminal

scoop bucket add extras
scoop install extras/windows-terminal
Enter fullscreen mode Exit fullscreen mode

4. Install Oh-My-Posh, PSReadLine, gsudo, Terminal-Icons

scoop bucket add main
scoop install main/oh-my-posh
scoop install main/gsudo
scoop install extras/terminal-icons
notepad $PROFILE
----------------------------
# Activate Oh My Posh: 
oh-my-posh init pwsh --config "%USERPROFILE%\scoop\apps\oh-my-posh\current\themes\1_shell.omp.json" | Invoke-Expression
# Activate Oh PSReadLine: 
Import-Module PSReadLine
# Activate gsudo  to elevate a command or the last command:
Import-Module gsudoModule
# Activate Terminal-Icons
Import-Module Terminal-Icons
----------------------------
Enter fullscreen mode Exit fullscreen mode

5. Install NVM (Node.js Version Manager)

Download: https://github.com/coreybutler/nvm-windows/releases/download/1.1.12/nvm-setup.exe

6. Install pyenv to manage multiple versions of Python

Open Windows-Terminal:

Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/pyenv-win/pyenv-win/master/pyenv-win/install-pyenv-win.ps1" -OutFile "./install-pyenv-win.ps1"; &"./install-pyenv-win.ps1"
Enter fullscreen mode Exit fullscreen mode

7. Install Search Everything

Instead of using https://scoop.sh/#/apps to search a package. We can use Everything. Search: package json

scoop install extras/everything
Enter fullscreen mode Exit fullscreen mode

Image description

8. Install fastfetch

Instead of abandoned neofetch, we can use fastfetch.

scoop install fastfetch
Enter fullscreen mode Exit fullscreen mode

9. Test Everything

Image description

Image description

10. Tips & Tricks

1. Use Nerd Font

2. To update scoop package:

scoop update *
Enter fullscreen mode Exit fullscreen mode

3. nvm Guide: https://github.com/coreybutler/nvm-windows

4. pyenv Guide: https://github.com/pyenv-win/pyenv-win

That's it! We can now use scoop, nvm, and pyenv in one terminal. If you have any suggestions, just comment below!

Top comments (0)