What can you do with Powershell (for developers) ⚔💝 
Tags: productivity, windows, beginners, terminal
Published: 2017-12-18 06:11:56

---
title: What can you do with Powershell (for developers) ⚔💝
published: true
description: learning powershell for developers
tags: productivity, windows, beginners, terminal
---


![HERO](https://cdn.makeuseof.com/wp-content/uploads/2014/12/basic-powershell-commands-intro-670x335.png)

Normally developers talk about how much productive you can become by using command line tools but the sad thing is they always talk about iTerm or BASH may be ZSH but what about windows users. I know that command line in windows sucks but there is still some hope, here we have Powershell. Powershell has most of the commands like curl and ls (they work in windows style).

I decided to see how far I can go with Powershell and there is what I came up with.

## PowerShell is Customizable 🤓
You can change the prompt of PowerShell with different colors, many outputs and like all Bash kids, you can also view git statuses with modules like Post-git. If you want to go further and even change the title of the prompts.

Like BASH guys keep their configs in `~/.bashrc` we can save our configs in `~\Documents\WindowsPowerShell\profile.ps1`

You can remove bells with `Set-PSReadlineOption -BellStyle None`  or import modules like `Import-Module posh-git`

If you don't like the default prompt `C:\Users\jztsaurabh\Documents\WindowsPowerShell> ` yeah this one, then you can customize it too.

here is how I customized my prompt

{% gist https://gist.github.com/13e1a28ad9e4626601a43cbb2082f555 %}

that's how it looks with all cool customizations
![my powershell pic](https://cdn-images-1.medium.com/max/800/1*QYEq6RUPFfHflQRIqvoCng.png)


## Using Modules
If you like to view git status in command line then modules in PowerShell can help you.
You need to install [Post-git](https://www.powershellgallery.com/packages/posh-git/0.7.1)

You can also install it from PowerShell 😜
`Install-Module -Name posh-git  -Scope CurrentUser`

Some people like to use **Z** for jumping between nested folder structures.You can install [Z for PowerShell too](https://www.powershellgallery.com/packages/z/1.1.9).

just use
`Install-Module -Name z  -Scope CurrentUser`


## functions in PowerShell 🎁
Making functions are really easy in PowerShell if you want to run a number of commands at once, then functions may help you.
If you want to set-up a new machine you can run functions that can install git, Nodejs, Firefox or other software for you.

I made some functions like:

{% gist https://gist.github.com/3474019276b058ff6a0cc54f55d054f3 %}

## Aliases (Oh my Aliases 😍)
Aliases in Powershell are exactly what you expect from it. You can create shortcut commands and create an alias for an executable (they are better than adding everything in Environment variables).

I like to use grep

{% gist https://gist.github.com/9e8f07b5f2d34460778f1beb638832db %}

## Scoop for package management 📦
This is my favorite, I was searching for a package manager for windows like brew, If found chocolaty but it has outdated versions of the atom, and I found scoop it was just what I was looking for, it works, it doesn't need admin permission for installing apps. It just works fine.

You can install [scoop] by

{% gist https://gist.github.com/d26d4adfa40238650b43975a6d30b7f3 %}

You can use it like

{% gist https://gist.github.com/29c0da0042d9d8bb97d7673a88c60cb9 %}

## You know what I'm looking for good color schemes 💥
Ok, we have that too. You can install [concfg](https://github.com/lukesampson/concfg) once you got [scoop](https://scoop.sh). It has plenty of color schemes that you will definately enjoy.
here is the monokia colorscheme.

![monokai preview](https://github.com/lukesampson/concfg/blob/master/preset_examples/monokai.png?raw=true)

## Further reads
[stack overflow link of Powershell ps1](https://stackoverflow.com/questions/138144/what-s-in-your-powershell-profile-ps1-file)

[link of a good profile.ps1](https://gist.github.com/timsneath/19867b12eee7fd5af2ba)

[Powershell gallery](https://www.powershellgallery.com/)

[find Powershell configs](https://gist.github.com/search?utf8=%E2%9C%93&q=profile.ps1)

[My profile.ps1](https://gist.github.com/itsjzt/e7734809a2852a3ae915ce190c50dfff)