Install PowerShell on Kali Linux

I tried to install PowerShell on Kali Linux Rolling by following instructions on the GitHub page as well as other articles I found online and none of them worked. I’m going to tell you what worked for me.

In the past I’ve stuck to Bash and Python for all of my scripting needs because they work cross platform. My work issued laptop runs Windows 10 and I use Git Bash to run my simple shell scripts that I use mainly to slice, dice, and reformat data, and Python for everything else. I’m a big fan of using one cross platform scripting language when possible.

Lately I’ve found a need to dive into PowerShell to be able to understand a complex script that I took over from a departing coworker. I was really surprised at how easy it is to work with XML using PowerShell after struggling to read XML with Python and xmlstarlet. Add in some Unicode and dependency problems while switching back and forth between Python 2.7 and 3.5 and I knew is was time to give PowerShell a chance. This had me thinking about starting a personal project to create a cross platform script in PowerShell to manage pentests and reporting.

Let’s get started installing PowerShell on Kali.

Edit: Updated 9/25/2018

apt -y install apt-transport-https curl gnupg
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
wget http://archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu57_57.1-6_amd64.deb
dpkg -i libicu57_57.1-6_amd64.deb
echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch main" > /etc/apt/sources.list.d/powershell.list
apt-get update && apt -y install powershell

Now start PowerShell:
pwsh

If you get any errors when using certain PowerShell commands, like curl for example, check your aliases. Some common aliases that work by default on Windows aren’t set here. You’ll need to either use the expanded name or set a new alias.

(Visited 6,702 times, 2 visits today)

12 thoughts on “Install PowerShell on Kali Linux”

  1. Installing powershell_6.0.0 results in:
    Unpacking powershell (6.0.0-alpha.16-1ubuntu1.16.04.1) …
    dpkg: dependency problems prevent configuration of powershell:
    powershell depends on libicu55; however:
    Package libicu55 is not installed.

    dpkg: error processing package powershell (–install):
    dependency problems – leaving unconfigured
    Errors were encountered while processing:
    powershell

    get it here:
    http://archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu55_55.1-7_amd64.deb

    1. My post covers the need to install that as a prerequisite, so I’m not sure why you posted that since you didn’t ask a question.

  2. Works great on Kali Rolling 2018.1 as long as the dependancies are included (per instructions), however, I had to include a debian jessie repo for
    libssl1.0.0 prior to a successful install.

    Added to /etc/apt/sources.list.d
    https://packages.debian.org/jessie/amd64/libssl1.0.0/download

    then manually installed libssl1.0.0 using the link on the same page
    http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.0.0_1.0.1t-1+deb8u8_amd64.deb

  3. hi, whenever i try installing the PowerShell Ubuntu 16.04 deb package it gives me the below error:

    dpkg: dependency problems prevent configuration of powershell:
    powershell depends on libcurl3; however:
    Package libcurl3 is not installed.

    dpkg: error processing package powershell (–install):
    dependency problems – leaving unconfigured
    Processing triggers for man-db (2.8.3-2) …
    Errors were encountered while processing:
    powershell

    after checking, i have libcurl4 installed on my system

    so i tried downgrading and installed libcurl3, a catastrophe happened, it started uninstalling many frameworks and tools!!!!

    luckily there was a way to restore what has been uninstalled

    can you please help?

    are their any packages that comply with libcurl4?

    I am using kali linux 2018.2

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.