Skip to content

Instantly share code, notes, and snippets.

---
driver:
name: vagrant
provisioner:
name: chef_zero
platforms:
- name: windows-2012R2
driver_config:
function Disable-NicICS {
$cfg = New-Object -ComObject HNetCfg.HNetShare.1
$all = $cfg.EnumEveryConnection
foreach($conn in $all){
$shareCfg=$cfg.INetSharingConfigurationForINetConnection($conn)
$props=$cfg.NetConnectionProps($conn)
$props
$shareCfg.DisableSharing()
}
}
cinst windirstat --allowEmptyChecksums
cinst dotpeek --allowEmptyChecksums
. { iwr -useb https://omnitruck.chef.io/install.ps1 } | iex; install -channel current -project chefdk -v 0.13.21
choco install notepad2 --version 4.2.25.3
if ($PSVersionTable.PSVersion.Major -le 4)
{
invoke-webrequest "https://download.microsoft.com/download/2/C/6/2C6E1B4A-EBE5-48A6-B225-2D2058A9CEFB/Win8.1AndW2K12R2-KB3134758-x64.msu" -outfile c:\wmf5.msu
start-process wusa -ArgumentList "c:\wmf5.msu", "/quiet", "/norestart" -wait
if(test-path c:\wmf5.msu){remove-item c:\wmf5.msu}
}
# Configure basic system settings
Update-ExecutionPolicy Unrestricted
Set-ExplorerOptions -showFileExtensions
Enable-RemoteDesktop
# Fix library locations
Move-LibraryDirectory "Personal" "$env:UserProfile\OneDrive\Documents"
Move-LibraryDirectory "My Music" "$env:UserProfile\OneDrive\Music"
Move-LibraryDirectory "My Pictures" "$env:UserProfile\OneDrive\Pictures"
Move-LibraryDirectory "My Video" "$env:UserProfile\OneDrive\Videos"
@mwrock
mwrock / gist:4d4cba7509c254873fad
Created February 19, 2016 21:57
Vagrant windows detect
if ((Test-Path $env:systemroot) -and (get-item $env:systemroot).PSIsContainer) {
exit 0
}
exit 1
@mwrock
mwrock / gist:b786baf10e9ea0b3cbd9
Last active December 21, 2015 04:24
cinst hyperv
cinst VisualStudio2013Professional -y
@mwrock
mwrock / gist:9b8f613178d36c9aef48
Created December 11, 2015 15:30
force-reboot
try {
$rebootFile = "$($boxstarter.BaseDir)\reboot-test.txt"
if(!(Test-Path $rebootFile)) {
new-Item $rebootFile -value "hi1" -type file
write-host "rebooting"
return Invoke-Reboot
}
write-host "I am done"
del $rebootFile