parent
be5011d459
commit
1376f493ff
@ -0,0 +1,44 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
require "date"
|
||||
require "fileutils"
|
||||
|
||||
Vagrant.require_version ">= 1.6.2"
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
#config.vm.define "gheis-" + DateTime.now.strftime("%Y-%m-%d-%H-%M-%S")
|
||||
config.vm.define "gheis-" + DateTime.now.strftime("%Y-%m-%d")
|
||||
config.vm.box = "windows_10_x86_virtualbox.box"
|
||||
config.vm.communicator = "winrm"
|
||||
|
||||
config.vm.hostname = "gheis"
|
||||
|
||||
# Admin user name and password
|
||||
config.winrm.username = "vagrant"
|
||||
config.winrm.password = "V@grant123"
|
||||
|
||||
config.vm.guest = :windows
|
||||
config.windows.halt_timeout = 15
|
||||
|
||||
config.vm.network :forwarded_port, guest: 3389, host: 3389, id: "rdp", auto_correct: true
|
||||
|
||||
config.vm.provider :virtualbox do |v, override|
|
||||
#v.gui = true
|
||||
v.customize ["modifyvm", :id, "--memory", 2048]
|
||||
v.customize ["modifyvm", :id, "--cpus", 2]
|
||||
v.customize ["setextradata", "global", "GUI/SuppressMessages", "all" ]
|
||||
v.customize ["modifyvm", :id, "--accelerate2dvideo", "on"]
|
||||
v.customize ["modifyvm", :id, "--vram", 128]
|
||||
v.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
|
||||
v.customize ["modifyvm", :id, "--draganddrop", "bidirectional"]
|
||||
end
|
||||
|
||||
config.vm.synced_folder ".", "/vagrant", disabled: true
|
||||
config.vm.synced_folder "./synced", "/vagrant", create: true
|
||||
FileUtils.cp "../../scripts/vagrant-postinstall.psm1" "./synced"
|
||||
FileUtils.cp "../../scripts/wintriallab-postinstall.psm1" "./synced"
|
||||
FileUtils.cp "./bitchbox-postinstall.ps1" "./synced"
|
||||
|
||||
config.vm.provision "shell", inline: "C:/marionettist/bitchbox-postinstall.ps1"
|
||||
end
|
@ -0,0 +1,82 @@
|
||||
[cmdletbinding()] param(
|
||||
[string] $newUsername = "mrled",
|
||||
[string] $newPassword = "boggy slab st droop speck"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
# REMINDER: This runs under the vagrant account, NOT under the account of the user I'll use to log in
|
||||
|
||||
Get-Module |? -Property Name -match "wintriallab-postinstall" | Remove-Module
|
||||
Import-Module $PSScriptRoot\wintriallab-postinstall.psm1
|
||||
|
||||
Invoke-ScriptblockAndCatch -scriptBlock {
|
||||
|
||||
# Create my day-to-day user
|
||||
Add-LocalSamUser -userName "$newUsername" -password $newPassword
|
||||
Add-LocalSamUserToGroup -userName "$newUsername" -groupName "Administrators"
|
||||
Set-PasswordExpiry -accountName "$newUsername" -disable
|
||||
|
||||
$secureNewPassword = ConvertTo-SecureString -String $newPassword -Force -AsPlainText
|
||||
$newAccountCreds = New-Object System.Management.Automation.PSCredential $newUsername,$secureNewPassword
|
||||
|
||||
# Install apps
|
||||
$chocolateyPackages = @(
|
||||
"git.install"
|
||||
"terminals"
|
||||
"Firefox"
|
||||
"thunderbird"
|
||||
"ConEmu"
|
||||
"dropbox"
|
||||
"Everything"
|
||||
"sysinternals"
|
||||
"putty.install"
|
||||
"sublimetext3"
|
||||
"Emacs"
|
||||
"vim"
|
||||
"PsGet"
|
||||
)
|
||||
$chocolateyPackages |% { Invoke-ExpressionEx "choco install --yes '$_'" }
|
||||
|
||||
Invoke-Command -ComputerName localhost -Creds $newAccountCreds -EnableNetworkAccess -ScriptBlock {
|
||||
Import-Module C:\vagrant\wintriallab-postinstall.psm1
|
||||
|
||||
$suoParams = @{
|
||||
ShowHiddenFiles = $true
|
||||
ShowFileExtensions = $true
|
||||
ShowStatusBar = $true
|
||||
DisableSharingWizard = $true
|
||||
EnablePSOnWinX = $true
|
||||
EnableQuickEdit = $true
|
||||
DisableSystrayHide = $true
|
||||
DisableIEFirstRunCustomize = $true
|
||||
}
|
||||
Set-UserOptions @suoParams
|
||||
|
||||
try {
|
||||
$ErrorActionPreference = "Continue"
|
||||
Set-PinnedApplication -Action UnpinFromTaskbar -Filepath "C:\Program Files\WindowsApps\Microsoft.WindowsStore_2015.10.5.0_x86__8wekyb3d8bbwe\WinStore.Mobile.exe" -ErrorAction Continue
|
||||
Set-PinnedApplication -Action PinToTaskbar -Filepath "${env:ProgramFiles}\ConEmu\ConEmu.exe"
|
||||
#Set-PinnedApplication -Action PinToTaskbar -Filepath "${env:SystemRoot}\system32\eventvwr.msc"
|
||||
$UserPinnedTaskBar = "${env:AppData}\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar"
|
||||
if (test-path "$UserPinnedTaskBar\Server Manager.lnk") { rm "$UserPinnedTaskBar\Server Manager.lnk" }
|
||||
}
|
||||
catch {}
|
||||
finally {
|
||||
$ErrorActionPreference = "Stop"
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
# missing apps:
|
||||
# - Discord
|
||||
# - iCloud
|
||||
# - notepad2: broken, requires autoit anyway which isn't ideal. need to develop my own installer that doesn't replace notepad.exe, but tells all apps to use notepad2.exe
|
||||
# - 1password
|
||||
|
||||
# Configure apps:
|
||||
# This is done BY HAND because I'm going to copy my %USERPROFILE% all the time. Right?
|
||||
# - dhd shortcuts
|
||||
# - terminals config file
|
||||
# - evernote creds
|
||||
# - dropbox creds
|
Loading…
Reference in new issue