“If someone told me 10 years ago that we (Microsoft) would offer SQL Server on Linux, I would have laughed them out of the room.” – Presenter while at Microsoft HQ Redmond, WA
It’s 2016 and Microsoft is breaking down the walls to its golden garden. With recent announcements coming from all across the board at Microsoft, it really is an interesting time. Never before have the tech giants been so open to sharing software across distributions and vendors.
In the early 1980s, Richard Matthew Stallman began a movement within the software industry, preaching that software should be free.
“Free software” is a matter of liberty, not price. To understand the concept, you should think of “free” as in “free speech,” not as in “free beer.”
Why would anyone in their right mind want to give away their software for free? I think the better question is: “How do we enable ourselves as developers and users, while protecting ourselves at the same time?” A user of the software should never be forced to deal with a developer who might or might not support that user’s intentions for the software. The user should never have to wait for bug fixes to be published. Code developed under the scrutiny of other programmers is typically of higher quality than code written behind locked doors. (We have been looking at you Apple and Microsoft) One of the great benefits of open source software comes from the users themselves. If a user desires or has the need for a new feature, they can add it to the original program and then contribute it back to the source so that everyone else can benefit from it. It is this sole reason why the popularity of GitHub has risen so dramatically in the last couple of years.
This line of thinking sprung a desire to release a complete UNIX-like system (Linux) to the public, free of license restrictions.
Just a couple of weeks ago Microsoft released this blog article announcing its latest “customer obsessed” move and to further convince us that “Microsoft loves Linux.” PowerShell and Visual Studio can now be ran on Linux and OSX.
It’s about time.
I have been running OSX Sierra on my 2015 13-inch MacBook Pro for as long as the public beta has been available, and now I can edit and run my PowerShell scripts directly in my Terminal.
Firstly you will need to download the PKG package
powershell-6.0.0-alpha.9.pkg from the page from here onto your macOS machine.
Either double-click the file and follow the prompts, or install it from the terminal.
Once the package has been installed, running the command
powershell puts you directly into a PowerShell session in your Mac OSX terminal:
/usr/local/microsoft/powershell/6.0.0-alpha.9/, and the symlink is placed at
- Download Visual Studio Code for Mac OS X.
- Double-click on the downloaded archive to expand the contents.
Visual Studio Code.app to the
Applications folder, making it available in the
- Add VS Code to your Dock by right-clicking on the icon and choosing
Keep in Dock.
Tip: If you want to run VS Code from the terminal by simply typing ‘code’, VS Code has a command, Shell Command: Install ‘code’ command in PATH, to add ‘code’ to your
After installation, launch VS Code. Now open the Command Palette (⇧⌘P) and type
shell command to find the Shell Command: Install ‘code’ command in PATH command.
After executing the command, restart the terminal for the new
$PATH value to take effect. You’ll be able to simply type ‘code .’ in any folder to start editing files in that folder.
Installing PowerShell Extension
Launch the Visual Studio Code app by:
- Windows: typing code in your PowerShell session
- Press F1 (or Ctrl+Shift+P) which opens up the “Command Palette” inside the Visual Studio Code app.
- In the command palette, type ext install and hit Enter. It will show all Visual Studio Code extensions available on your system.
- Choose PowerShell and click on Install, you will see something like below
- After the install, you will see the Install button turns to Enable.
- Click on Enable and OK
- Now you are ready for editing. For example, to create a new file, click File->New. To save it, click File->Save and then provide a file name, let’s say “helloworld.ps1”. To close the file, click on “x” next to the file name. To exit Visual Studio Code, File->Exit.
For further information, check out Microsoft’s documentation on GitHub: