Skip to content

Instantly share code, notes, and snippets.

@russellseymour
Last active April 22, 2017 14:11
Show Gist options
  • Save russellseymour/55c68f745470ffd03ef98fa6f13144c7 to your computer and use it in GitHub Desktop.
Save russellseymour/55c68f745470ffd03ef98fa6f13144c7 to your computer and use it in GitHub Desktop.
# List the applications that need to be installed
# This is a hash table with options being set that allow configuration during install
applications = {
"git" => {},
"visualstudiocode" => {},
"7zip" => {},
"slack" => {},
"googlechrome" => {},
"dropbox" => {},
"awstools.powershell" => {},
"awscli" => {},
"windowsazurepowershell" => {},
"1password" => {}
}
# Define the list of gems that need to be installed
gems = {
"kitchen-pester" => {},
"kitchen-hyperv" => {},
"kitchen-dsc" => {},
"kitchen-azurerm" => {},
"azure-credentials" => {},
"pry" => {},
"pry-byebug" => {},
"pry-stack_explorer" => {},
"appbundle-updater" => {}
}
# set the list of VS code extensions to install
extensions = {
"code-settings-sync" => {}
}
# Iterate around the applications
applications.each do |name, details|
chocolatey_package name do
if details.key?("options")
options details["options"]
end
end
end
# Iterate around the gems to be installed
gems.each do |name, details|
chef_gem name do
compile_time false if respond_to?(:compile_time)
end
end
# Install the VSCode extensions
extensions.each do |name, details|
execute "install vscode extension #{name}" do
command "code --install-extension #{name}"
end
end
# Install the NuGet package provider for PowerShell
powershell_script "Install-PackageProvider -Name NuGet"
# Setup my execution policy for both the 64 bit and 32 bit shells
set-executionpolicy remotesigned -force
start-job -runas32 {set-executionpolicy remotesigned -force} | receive-job -wait
# Install ChefDK
invoke-restmethod 'https://omnitruck.chef.io/install.ps1' | iex
install-project chefdk -verbose -version 1.3.43
# Install Chocolatey
invoke-expression ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
choco feature enable -n allowGlobalConfirmation
# Download the Ruby setup file
$url = "http://tinyurl.com/kffqb35"
Invoke-RestMethod -UseBasicParsing $url | Out-File -encoding ascii -filepath c:/basic.rb
# Now run the setup
chef-apply c:/basic.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment