Skip to content

Instantly share code, notes, and snippets.

@iainbrighton
Created March 11, 2018 20:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iainbrighton/cfb3e44fa83321a7734ab7dd7dd1a680 to your computer and use it in GitHub Desktop.
Save iainbrighton/cfb3e44fa83321a7734ab7dd7dd1a680 to your computer and use it in GitHub Desktop.
PowerShell DSC 101 Workshop Prep Script
#requires -RunAsAdministrator
#requires -Version 5
<#
For the PowerShell Desired State Configuration 101 Workshop you will need
the following:
1. A Windows 2016 virtual machine. This can be any hypervisor you have
available e.g. Hyper-V, VMware Workstation or VirtualBox.
2. If you don't have a copy you can download the evaluation ISO file from
the Windows Evaluation Center:
https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2016
3. You will need to run this script INSIDE the virtual machine BEFORE the
workshop commences (there is no guarantee of internet access on the
day so don't count on cloud VMs either!).
#>
## Install the NuGet provider required by PowerShellGet
if (-not (Get-PackageProvider -Name NuGet -ListAvailable)) {
Install-PackageProvider -Name NuGet -ForceBootstrap -Force -ErrorAction Stop -Verbose
}
## Install required modules from the PowerShell Gallery
foreach ($module in 'xNetworking', 'xWinEventLog', 'xWebAdministration', 'PSDscResources', 'PolicyFileEditor') {
if (-not (Get-Module -Name $module -ListAvailable)) {
Install-Module -Name $module -Force -ErrorAction Stop -Verbose
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment