a-mcf / VagrantPowerShellExamples

Examples of how to use Vagrant with Windows guests generally, and PowerShell specifically.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vagrant for the PowerShell Developer

What follows is a set of notes and examples for use in demonstrating some use cases with Vagrant and Windows.

The initial scenarios (1-6) were demonstrated to the Cincinati PowerShell Users group on 8/17/2017. Here is the video

Scenarios 7+ are being added as I continue to experiment with different provisioners.

What is Vagrant

  • Vagrant is an open source tool created by HashiCorp for rapidly creating portable, reproducible development environments.
  • Supports Virtualbox, Hyper-V, and Docker out of the box, and many more through it’s pluggable provider system.
  • Works by abstracting away the hypervisor.
  • You interact with Vagrant through a configuration file and the ‘vagrant’ command.

Configuration Notes

  • You must install Vagrant and supported hypervisor.
  • For this demo, we will use Virtualbox. Because it’s cross-platform, this will enable you to share your vagrant build with people running Windows, Mac, or Linux.
  • If you have Hyper-V installed, you can’t run Virtualbox so long as it’s enabled. One excellent way around this is to create a boot profile that disables Hyper-V without uninstalling it. Scott Hansleman has an excellent blog detailing how this is done.
  • Being *NIX first, Vagrant supports ANSI color on the command line, but doesn't automatically turn it on for Windows. If you have the Windows 10 creators update, you can enable this by setting the 'VAGRANT_FORCE_COLOR' environment variable to any value or pass the --color parameter.. If you're using an older OS you can use Cmder use vagrant --color or $env:VAGRANT_FORCE_COLOR to enable colors on windows.

About

Examples of how to use Vagrant with Windows guests generally, and PowerShell specifically.


Languages

Language:Ruby 67.9%Language:PowerShell 32.1%