diff --git a/.gitignore b/.gitignore
index b48070c..310309c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,4 +4,9 @@ packer_cache/
# For built boxes
*.box
license.json
-.vs
\ No newline at end of file
+.vs
+.vagrant
+
+# keys
+*.pfx
+*.pem
diff --git a/Qlik-Cli.psd1 b/Qlik-Cli.psd1
index da139d6..8838add 100644
--- a/Qlik-Cli.psd1
+++ b/Qlik-Cli.psd1
@@ -12,7 +12,7 @@
RootModule = 'Qlik-Cli.psm1'
# Version number of this module.
-ModuleVersion = '1.15.0'
+ModuleVersion = '1.15.1'
# ID used to uniquely identify this module
GUID = '730275fa-35db-42e2-9400-eac7e3043ea4'
diff --git a/functions/core.ps1 b/functions/core.ps1
index 8a49838..f355d0f 100644
--- a/functions/core.ps1
+++ b/functions/core.ps1
@@ -25,11 +25,19 @@ function CallRestUri($method, $path, $extraParams) {
If( $params.Body ) { Write-Verbose $params.Body }
Write-Verbose "Calling $method for $path"
- If( $null -eq $script:webSession ) {
- $result = Invoke-RestMethod -Method $method -Uri $path @params -SessionVariable webSession
- $script:webSession = $webSession
- } else {
- $result = Invoke-RestMethod -Method $method -Uri $path @params -WebSession $script:webSession
+ try {
+ If( $null -eq $script:webSession ) {
+ $result = Invoke-RestMethod -Method $method -Uri $path @params -SessionVariable webSession
+ $script:webSession = $webSession
+ } elseif ($params.OutFile) {
+ $result = Invoke-WebRequest -Method $method -Uri $path @params -WebSession $script:webSession
+ } else {
+ $result = Invoke-RestMethod -Method $method -Uri $path @params -WebSession $script:webSession
+ }
+ }
+ catch {
+ throw $_
+ return
}
if( !$rawOutput ) {
diff --git a/packer/2012r2-virtualbox.json b/packer/2012r2-virtualbox.json
deleted file mode 100644
index 25d2243..0000000
--- a/packer/2012r2-virtualbox.json
+++ /dev/null
@@ -1,206 +0,0 @@
-{
- "builders": [
- {
- "type": "virtualbox-iso",
- "vm_name": "vagrant-w2012r2",
- "iso_url": "http://download.microsoft.com/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.16384.WINBLUE_RTM.130821-1623_X64FRE_SERVER_EVAL_EN-US-IRM_SSS_X64FREE_EN-US_DV5.ISO",
- "iso_checksum_type": "md5",
- "iso_checksum": "458ff91f8abc21b75cb544744bf92e6a",
- "communicator": "winrm",
- "winrm_username": "vagrant",
- "winrm_password": "vagrant",
- "headless": true,
- "boot_wait": "1m",
- "guest_additions_mode": "attach",
- "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
- "guest_os_type": "Windows2012_64",
- "disk_size": 61440,
- "floppy_files": [
- "./answer_files/2012_r2/Autounattend.xml",
- "./scripts/microsoft-updates.bat",
- "./scripts/win-updates.ps1",
- "./scripts/oracle-cert.cer",
- "./scripts/disable-password-complexity.ps1"
- ],
- "vboxmanage": [
- [
- "modifyvm",
- "{{.Name}}",
- "--memory",
- "2048"
- ],
- [
- "modifyvm",
- "{{.Name}}",
- "--cpus",
- "2"
- ],
- [
- "modifyvm",
- "{{.Name}}",
- "--natpf1",
- "guestwinrm,tcp,127.0.0.1,5985,,5985"
- ]
- ],
- "vboxmanage_post": [
- [
- "storageattach",
- "{{.Name}}",
- "--storagectl",
- "IDE Controller",
- "--port",
- "1",
- "--device",
- "0",
- "--type",
- "dvddrive",
- "--medium",
- "emptydrive"
- ]
- ]
- },
- {
- "type": "virtualbox-ovf",
- "vm_name": "vagrant-w2012r2",
- "source_path": "./output-virtualbox-iso/vagrant-w2012r2.ovf",
- "headless": true,
- "guest_additions_mode": "disable",
- "boot_wait": "30s",
- "communicator": "winrm",
- "winrm_username": "vagrant",
- "winrm_password": "vagrant",
- "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
- "shutdown_timeout": "10m",
- "vboxmanage": [
- [
- "modifyvm",
- "{{.Name}}",
- "--memory",
- "2048"
- ],
- [
- "modifyvm",
- "{{.Name}}",
- "--vram",
- "64"
- ],
- [
- "modifyvm",
- "{{.Name}}",
- "--cpus",
- "2"
- ],
- [
- "sharedfolder",
- "add",
- "{{.Name}}",
- "--name",
- "setup_files",
- "--hostpath",
- "{{pwd}}/setup_files",
- "--automount"
- ]
- ],
- "vboxmanage_post": [
- [
- "sharedfolder",
- "remove",
- "{{.Name}}",
- "--name",
- "setup_files"
- ]
- ]
- },
- {
- "type": "virtualbox-ovf",
- "name": "virtualbox-sysprep",
- "source_path": "./output-virtualbox-ovf/vagrant-w2012r2.ovf",
- "headless": true,
- "guest_additions_mode": "disable",
- "boot_wait": "30s",
- "communicator": "winrm",
- "winrm_username": "vagrant",
- "winrm_password": "vagrant",
- "shutdown_command": "c:/windows/system32/sysprep/sysprep.exe /generalize /oobe /quiet /shutdown /unattend:c:/Windows/Temp/Autounattend_sysprep.xml",
- "shutdown_timeout": "15m",
- "vboxmanage": [
- [
- "modifyvm",
- "{{.Name}}",
- "--memory",
- "2048"
- ],
- [
- "modifyvm",
- "{{.Name}}",
- "--vram",
- "64"
- ],
- [
- "modifyvm",
- "{{.Name}}",
- "--cpus",
- "2"
- ]
- ]
- }
- ],
- "provisioners": [
- {
- "type": "powershell",
- "scripts": [
- "./scripts/virtualbox-guest-tools.ps1",
- "./scripts/disable-password-complexity.ps1"
- ],
- "only":["virtualbox-iso"]
- },
- {
- "type": "windows-shell",
- "scripts": [
- "./scripts/enable-rdp.bat",
- "./scripts/compile-dotnet-assemblies.bat"
- ],
- "only":["virtualbox-iso"]
- },
- {
- "type": "powershell",
- "elevated_user": "vagrant",
- "elevated_password": "vagrant",
- "scripts": [
- "./scripts/dis-updates.ps1",
- "./scripts/dotnet.ps1",
- "./scripts/wmf.ps1"
- ],
- "only":["virtualbox-ovf"]
- },
- {
- "type": "windows-shell",
- "scripts": [
- "./scripts/disable-auto-logon.bat"
- ],
- "only":["virtualbox-ovf"]
- },
- {
- "type": "powershell",
- "scripts": [
- "./scripts/cleanup.ps1"
- ],
- "only":["virtualbox-ovf"]
- },
- {
- "type": "file",
- "source": "./answer_files/2012_r2/Autounattend_sysprep.xml",
- "destination": "c:/Windows/Temp/Autounattend_sysprep.xml",
- "only":["virtualbox-sysprep"]
- }
- ],
- "post-processors": [
- {
- "type": "vagrant",
- "keep_input_artifact": true,
- "output": "windows2012r2-sysprep-{{.Provider}}.box",
- "vagrantfile_template": "vagrantfile-windows_2012_r2.template",
- "only":["virtualbox-sysprep"]
- }
- ]
-}
diff --git a/packer/LICENSE b/packer/LICENSE
deleted file mode 100644
index 9d720ba..0000000
--- a/packer/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2015 Matt Fellows
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
diff --git a/packer/README.md b/packer/README.md
deleted file mode 100644
index 3d0f6a6..0000000
--- a/packer/README.md
+++ /dev/null
@@ -1,30 +0,0 @@
-# Packer Example Template
-
-Based on [Packer Community Templates](https://github.com/mefellows/packer-community-templates) for Windows environments and modified to include dependencies for Qlik Sense and the DSC modules provided here.
-
-## Running
-
-* Install [Packer](https://github.com/mitchellh/packer/)
-* Clone this repo:
-
- ```
- git clone git@github.com:ahaydon/qlik-cli.git && cd qlik-cli
- ```
-
-* Run Packer
-
- Common practice is to create intermediate boxes in [machine image pipelines](http://www.onegeek.com.au/articles/machine-factories-part1-vagrant), such as a 'Base' and 'Application' images. The example below follows this pattern.
-
- ### Vagrant Boxes
-
- Run the ISO builder to produce a simple Base box with VirtualBox guest additions and optionally Windows updates (Uncomment the [relevant](/answer_files/2012_r2/Autounattend.xml#L243-L267) lines in the Autounattend.xml files to enable this):
-
- ```
- packer build -only=virtualbox-windows-iso 2012r2-virtualbox.json
- ```
-
- Run the OVF builder to produce a simple base box with Microsoft.Net 4.5.2 and Windows Management Framework 5 Preview installed:
-
- ```
- packer build -only=virtualbox-windows-ovf 2012r2-virtualbox.json
- ```
diff --git a/packer/answer_files/2012_r2/Autounattend.xml b/packer/answer_files/2012_r2/Autounattend.xml
deleted file mode 100644
index 4369f0b..0000000
--- a/packer/answer_files/2012_r2/Autounattend.xml
+++ /dev/null
@@ -1,305 +0,0 @@
-
-
-
-
-
- en-US
-
- en-GB
- en-GB
- en-US
- en-US
- en-GB
-
-
-
-
-
-
- Primary
- 1
- 350
-
-
- 2
- Primary
- true
-
-
-
-
- true
- NTFS
-
- 1
- 1
-
-
- NTFS
-
- C
- 2
- 2
-
-
- 0
- true
-
-
-
-
-
-
- /IMAGE/NAME
- Windows Server 2012 R2 SERVERSTANDARD
-
-
-
- 0
- 2
-
-
-
-
-
-
-
-
-
- OnError
-
- true
- Vagrant
- Vagrant
-
-
-
-
-
-
- false
-
- vagrant-2012-r2
- GMT Standard Time
-
-
-
- true
-
-
- false
- false
-
-
- true
-
-
- true
-
-
-
-
-
-
- vagrant
- true
-
- true
- vagrant
-
-
-
- cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy Bypass -Force"
- Set Execution Policy 64 Bit
- 1
- true
-
-
- C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy Bypass -Force"
- Set Execution Policy 32 Bit
- 2
- true
-
-
- cmd.exe /c winrm quickconfig -q
- winrm quickconfig -q
- 3
- true
-
-
- cmd.exe /c winrm quickconfig -transport:http
- winrm quickconfig -transport:http
- 4
- true
-
-
- cmd.exe /c winrm set winrm/config @{MaxTimeoutms="1800000"}
- Win RM MaxTimoutms
- 5
- true
-
-
- cmd.exe /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="512"}
- Win RM MaxMemoryPerShellMB
- 6
- true
-
-
- cmd.exe /c winrm set winrm/config/service @{AllowUnencrypted="true"}
- Win RM AllowUnencrypted
- 7
- true
-
-
- cmd.exe /c winrm set winrm/config/service/auth @{Basic="true"}
- Win RM auth Basic
- 8
- true
-
-
- cmd.exe /c winrm set winrm/config/client/auth @{Basic="true"}
- Win RM client auth Basic
- 9
- true
-
-
- cmd.exe /c winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"}
- Win RM listener Address/Port
- 10
- true
-
-
- cmd.exe /c netsh advfirewall firewall set rule group="remote administration" new enable=yes
- Win RM adv firewall enable
- 11
- true
-
-
- cmd.exe /c netsh firewall add portopening TCP 5985 "Port 5985"
- Win RM port open
- 12
- true
-
-
-
- %SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v HideFileExt /t REG_DWORD /d 0 /f
- 16
- Show file extensions in Explorer
-
-
- %SystemRoot%\System32\reg.exe ADD HKCU\Console /v QuickEdit /t REG_DWORD /d 1 /f
- 17
- Enable QuickEdit mode
-
-
- %SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v Start_ShowRun /t REG_DWORD /d 1 /f
- 18
- Show Run command in Start Menu
-
-
- %SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v StartMenuAdminTools /t REG_DWORD /d 1 /f
- 19
- Show Administrative Tools in Start Menu
-
-
- %SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateFileSizePercent /t REG_DWORD /d 0 /f
- 20
- Zero Hibernation File
-
-
- %SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateEnabled /t REG_DWORD /d 0 /f
- 21
- Disable Hibernation Mode
-
-
- cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE
- 22
- Disable password expiration for vagrant user
-
-
- cmd.exe /c powershell -File a:\disable-password-complexity.ps1
- Disable password complexity
- 23
- true
-
-
-
-
-
-
-
-
- true
- true
- true
- true
- true
- Home
- 1
-
-
-
- vagrant
- true
-
-
-
-
- vagrant
- true
-
- administrators
- Vagrant
- vagrant
- Vagrant User
-
-
-
-
-
-
-
-
- false
-
-
-
-
diff --git a/packer/answer_files/2012_r2/Autounattend_sysprep.xml b/packer/answer_files/2012_r2/Autounattend_sysprep.xml
deleted file mode 100644
index 2877aaf..0000000
--- a/packer/answer_files/2012_r2/Autounattend_sysprep.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
- 1
-
-
- false
- false
-
-
-
-
- en-GB
- en-GB
- en-US
- en-GB
-
-
-
- true
- 1
- Work
- true
-
-
-
- vagrant
- true
-
-
-
-
- vagrant
- true
-
- administrators
- Vagrant
- vagrant
- Vagrant User
-
-
-
- UTC
-
-
-
-
-
-
- XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
-
-
-
\ No newline at end of file
diff --git a/packer/scripts/cleanup.ps1 b/packer/scripts/cleanup.ps1
deleted file mode 100644
index 49107ff..0000000
--- a/packer/scripts/cleanup.ps1
+++ /dev/null
@@ -1,49 +0,0 @@
-# Let's cleanup!
-#
-# See http://www.hurryupandwait.io/blog/in-search-of-a-light-weight-windows-vagrant-box
-# for details!
-
-Write-Host "Disabling Remote Desktop Network Level Authentication"
-(Get-WmiObject -class "Win32_TSGeneralSetting" -Namespace root\cimv2\terminalservices -ComputerName $env:computerName -Filter "TerminalName='RDP-tcp'").SetUserAuthenticationRequired(0) > $null
-
-# Reduce PageFile size
-$System = GWMI Win32_ComputerSystem -EnableAllPrivileges
-$System.AutomaticManagedPagefile = $False
-$System.Put()
-
-$CurrentPageFile = gwmi -query "select * from Win32_PageFileSetting where name='c:\\pagefile.sys'"
-$CurrentPageFile.InitialSize = 512
-$CurrentPageFile.MaximumSize = 512
-$CurrentPageFile.Put()
-
-# Cleanup update uninstallers
-Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
-
- # Remove unnecessary features
- @('Desktop-Experience',
- 'InkAndHandwritingServices',
- 'Server-Media-Foundation',
- 'Powershell-ISE') | Remove-WindowsFeature
-
-$AvailableFeatures = @( 'AD-Domain-Services',
- 'RSAT-AD-PowerShell',
- 'RSAT-AD-Tools',
- 'RSAT-Role-Tools',
- 'RSAT',
- 'GPMC',
- 'RSAT-ADDS',
- 'RSAT-AD-AdminCenter',
- 'RSAT-ADDS-Tools')
-Get-WindowsFeature |
- ? { -Not ( $AvailableFeatures -Contains $_.Name ) -And $_.InstallState -eq 'Available' } |
- Uninstall-WindowsFeature -Remove
-
-# Defrag C
-Optimize-Volume -DriveLetter C
-
-wget http://download.sysinternals.com/files/sdelete.zip -OutFile sdelete.zip
-[System.Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem")
-[System.IO.Compression.ZipFile]::ExtractToDirectory("sdelete.zip", ".")
-
-reg.exe ADD "HKCU\Software\Sysinternals\SDelete" /v EulaAccepted /t REG_DWORD /d 1 /f
-./sdelete.exe -z c:
\ No newline at end of file
diff --git a/packer/scripts/compile-dotnet-assemblies.bat b/packer/scripts/compile-dotnet-assemblies.bat
deleted file mode 100644
index d8241c6..0000000
--- a/packer/scripts/compile-dotnet-assemblies.bat
+++ /dev/null
@@ -1,17 +0,0 @@
-::http://support.microsoft.com/kb/2570538
-::http://robrelyea.wordpress.com/2007/07/13/may-be-helpful-ngen-exe-executequeueditems/
-@echo off
-echo "Compiling .Net Assemblies"
-
-if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto 64BIT
-
-%windir%\microsoft.net\framework\v4.0.30319\ngen.exe executequeueditems >nul
-%windir%\microsoft.net\framework\v4.0.30319\ngen.exe executequeueditems >nul
-
-exit /b
-
-:64BIT
-%windir%\microsoft.net\framework\v4.0.30319\ngen.exe executequeueditems >nul
-%windir%\microsoft.net\framework64\v4.0.30319\ngen.exe executequeueditems >nul
-%windir%\microsoft.net\framework\v4.0.30319\ngen.exe executequeueditems >nul
-%windir%\microsoft.net\framework64\v4.0.30319\ngen.exe executequeueditems >nul
diff --git a/packer/scripts/dis-updates.ps1 b/packer/scripts/dis-updates.ps1
deleted file mode 100644
index d92397b..0000000
--- a/packer/scripts/dis-updates.ps1
+++ /dev/null
@@ -1,30 +0,0 @@
-<#
-.SYNOPSIS
- Disables automatic windows updates
-.DESCRIPTION
- Disables checking for and applying Windows Updates (does not prevent updates from being applied manually or being pushed down)
- Run on the machine that updates need disabling on.
-.PARAMETER
- None
-.EXAMPLE
- ./Disable-WindowsUpdates.ps1
-#>
-$RunningAsAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
-if ($RunningAsAdmin)
-{
-
- $Updates = (New-Object -ComObject "Microsoft.Update.AutoUpdate").Settings
-
- if ($Updates.ReadOnly -eq $True) { Write-Error "Cannot update Windows Update settings due to GPO restrictions." }
-
- else {
- $Updates.NotificationLevel = 1 #Disabled
- $Updates.Save()
- $Updates.Refresh()
- Write-Output "Automatic Windows Updates disabled."
- }
-}
-
-else
-{ Write-Warning "Must be executed in Administrator level shell."
- Write-Warning "Script Cancelled!" }
diff --git a/packer/scripts/disable-auto-logon.bat b/packer/scripts/disable-auto-logon.bat
deleted file mode 100644
index b3e8c04..0000000
--- a/packer/scripts/disable-auto-logon.bat
+++ /dev/null
@@ -1 +0,0 @@
-reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /d 0 /f
\ No newline at end of file
diff --git a/packer/scripts/disable-password-complexity.ps1 b/packer/scripts/disable-password-complexity.ps1
deleted file mode 100644
index 7f15138..0000000
--- a/packer/scripts/disable-password-complexity.ps1
+++ /dev/null
@@ -1,8 +0,0 @@
-# works on Microsoft Windows Server 2008 #carriage return
-secedit /export /cfg c:\new.cfg #carriage return
-#start-sleep -s 5 #carriage return
-((get-content c:\new.cfg) -replace ('PasswordComplexity = 1', 'PasswordComplexity = 0')) | Out-File c:\new.cfg #carriage return
-secedit /configure /db $env:windir\security\new.sdb /cfg c:\new.cfg /areas SECURITYPOLICY #carriage return
-Rename-Item c:\new.cfg c:\new.cfg.txt #carriage return
-write-host "That's all folks!" #carriage return
-rm c:\new.cfg.txt
\ No newline at end of file
diff --git a/packer/scripts/dotnet.ps1 b/packer/scripts/dotnet.ps1
deleted file mode 100644
index 01f96fe..0000000
--- a/packer/scripts/dotnet.ps1
+++ /dev/null
@@ -1,19 +0,0 @@
-$drive = (Gwmi Win32_mappedLogicalDisk -filter "ProviderName='\\\\vboxsrv\\setup_files'").name
-$dotnet_url = "http://download.microsoft.com/download/E/2/1/E21644B5-2DF2-47C2-91BD-63C560427900/NDP452-KB2901907-x86-x64-AllOS-ENU.exe"
-
-if (!(Test-Path "$drive\NDP452-KB2901907-x86-x64-AllOS-ENU.exe")) {
- Write-Host "Downloading .Net 4.5.2 setup file"
- $dotnet_installer = "$env:temp\NDP452-KB2901907-x86-x64-AllOS-ENU.exe"
- (New-Object System.Net.WebClient).DownloadFile($dotnet_url, $dotnet_installer)
-} else {
- $dotnet_installer = "$drive\NDP452-KB2901907-x86-x64-AllOS-ENU.exe"
-}
-
-write-host "Compiling .Net Assemblies"
-start "$env:windir\microsoft.net\framework\v4.0.30319\ngen.exe" "executequeueditems" > $null
-start "$env:windir\microsoft.net\framework64\v4.0.30319\ngen.exe" "executequeueditems" > $null
-write-host "Installing .Net Framework"
-start $dotnet_installer @("/q", "/norestart") -wait
-write-host "Compiling .Net Assemblies"
-start "$env:windir\microsoft.net\framework\v4.0.30319\ngen.exe" "executequeueditems" > $null
-start "$env:windir\microsoft.net\framework64\v4.0.30319\ngen.exe" "executequeueditems" > $null
diff --git a/packer/scripts/enable-rdp.bat b/packer/scripts/enable-rdp.bat
deleted file mode 100644
index f7dcaab..0000000
--- a/packer/scripts/enable-rdp.bat
+++ /dev/null
@@ -1,2 +0,0 @@
-netsh advfirewall firewall add rule name="Open Port 3389" dir=in action=allow protocol=TCP localport=3389
-reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
diff --git a/packer/scripts/microsoft-updates.bat b/packer/scripts/microsoft-updates.bat
deleted file mode 100644
index 2cb8fa0..0000000
--- a/packer/scripts/microsoft-updates.bat
+++ /dev/null
@@ -1,12 +0,0 @@
-net stop wuauserv
-
-reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v EnableFeaturedSoftware /t REG_DWORD /d 1 /f
-
-reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v IncludeRecommendedUpdates /t REG_DWORD /d 1 /f
-
-echo Set ServiceManager = CreateObject("Microsoft.Update.ServiceManager") > A:\temp.vbs
-echo Set NewUpdateService = ServiceManager.AddService2("7971f918-a847-4430-9279-4a52d1efe18d",7,"") >> A:\temp.vbs
-
-cscript A:\temp.vbs
-
-net start wuauserv
\ No newline at end of file
diff --git a/packer/scripts/oracle-cert.cer b/packer/scripts/oracle-cert.cer
deleted file mode 100644
index abb6ee6..0000000
Binary files a/packer/scripts/oracle-cert.cer and /dev/null differ
diff --git a/packer/scripts/virtualbox-guest-tools.ps1 b/packer/scripts/virtualbox-guest-tools.ps1
deleted file mode 100644
index 347ecba..0000000
--- a/packer/scripts/virtualbox-guest-tools.ps1
+++ /dev/null
@@ -1,16 +0,0 @@
-# If the ISO is uploaded, unzip and install
-#if ( Test-Path "C:\Users\vagrant\VBoxGuestAdditions.iso" ) {
- # There needs to be Oracle CA (Certificate Authority) certificates installed in order
- # to prevent user intervention popups which will undermine a silent installation.
- cmd /c certutil -addstore -f "TrustedPublisher" A:\oracle-cert.cer
-
- # We also need to download 7zip...
- # if ( -not ( Test-Path "C:\Windows\Temp\7z920-x64.msi") -and -not( get-command '7z' -ErrorAction SilentlyContinue ) ) {
- # cmd /c powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://softlayer-sng.dl.sourceforge.net/project/sevenzip/7-Zip/9.38/7z938-extra.7z', 'C:\Windows\Temp\7z920-x64.msi')"
- # cmd /c msiexec /qb /i C:\Windows\Temp\7z920-x64.msi
- # }
- # cmd /c move /Y C:\Users\vagrant\VBoxGuestAdditions.iso C:\Windows\Temp
- # cmd /c "C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox
- cmd /c E:\VBoxWindowsAdditions.exe /S
- # rm C:\Windows\Temp\VBoxGuestAdditions.iso
-#}
\ No newline at end of file
diff --git a/packer/scripts/win-updates.ps1 b/packer/scripts/win-updates.ps1
deleted file mode 100644
index 4cb01cc..0000000
--- a/packer/scripts/win-updates.ps1
+++ /dev/null
@@ -1,170 +0,0 @@
-param($global:RestartRequired=0,
- $global:MoreUpdates=0,
- $global:MaxCycles=5)
-
-function Check-ContinueRestartOrEnd() {
- $RegistryKey = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
- $RegistryEntry = "InstallWindowsUpdates"
- switch ($global:RestartRequired) {
- 0 {
- $prop = (Get-ItemProperty $RegistryKey).$RegistryEntry
- if ($prop) {
- Write-Host "Restart Registry Entry Exists - Removing It"
- Remove-ItemProperty -Path $RegistryKey -Name $RegistryEntry -ErrorAction SilentlyContinue
- }
-
- Write-Host "No Restart Required"
- Check-WindowsUpdates
-
- if (($global:MoreUpdates -eq 1) -and ($script:Cycles -le $global:MaxCycles)) {
- Install-WindowsUpdates
- } elseif ($script:Cycles -gt $global:MaxCycles) {
- Write-Host "Exceeded Cycle Count - Stopping"
- } else {
- Write-Host "Done Installing Windows Updates"
- Invoke-Expression "a:\openssh.ps1 -AutoStart"
- }
- }
- 1 {
- $prop = (Get-ItemProperty $RegistryKey).$RegistryEntry
- if (-not $prop) {
- Write-Host "Restart Registry Entry Does Not Exist - Creating It"
- Set-ItemProperty -Path $RegistryKey -Name $RegistryEntry -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File $($script:ScriptPath)"
- } else {
- Write-Host "Restart Registry Entry Exists Already"
- }
-
- Write-Host "Restart Required - Restarting..."
- Restart-Computer
- }
- default {
- Write-Host "Unsure If A Restart Is Required"
- break
- }
- }
-}
-
-function Install-WindowsUpdates() {
- $script:Cycles++
- Write-Host 'Evaluating Available Updates:'
- $UpdatesToDownload = New-Object -ComObject 'Microsoft.Update.UpdateColl'
- foreach ($Update in $SearchResult.Updates) {
- if (($Update -ne $null) -and (!$Update.IsDownloaded)) {
- [bool]$addThisUpdate = $false
- if ($Update.InstallationBehavior.CanRequestUserInput) {
- Write-Host "> Skipping: $($Update.Title) because it requires user input"
- } else {
- if (!($Update.EulaAccepted)) {
- Write-Host "> Note: $($Update.Title) has a license agreement that must be accepted. Accepting the license."
- $Update.AcceptEula()
- [bool]$addThisUpdate = $true
- } else {
- [bool]$addThisUpdate = $true
- }
- }
-
- if ([bool]$addThisUpdate) {
- Write-Host "Adding: $($Update.Title)"
- $UpdatesToDownload.Add($Update) |Out-Null
- }
- }
- }
-
- if ($UpdatesToDownload.Count -eq 0) {
- Write-Host "No Updates To Download..."
- } else {
- Write-Host 'Downloading Updates...'
- $Downloader = $UpdateSession.CreateUpdateDownloader()
- $Downloader.Updates = $UpdatesToDownload
- $Downloader.Download()
- }
-
- $UpdatesToInstall = New-Object -ComObject 'Microsoft.Update.UpdateColl'
- [bool]$rebootMayBeRequired = $false
- Write-Host 'The following updates are downloaded and ready to be installed:'
- foreach ($Update in $SearchResult.Updates) {
- if (($Update.IsDownloaded)) {
- Write-Host "> $($Update.Title)"
- $UpdatesToInstall.Add($Update) |Out-Null
-
- if ($Update.InstallationBehavior.RebootBehavior -gt 0){
- [bool]$rebootMayBeRequired = $true
- }
- }
- }
-
- if ($UpdatesToInstall.Count -eq 0) {
- Write-Host 'No updates available to install...'
- $global:MoreUpdates=0
- $global:RestartRequired=0
- Invoke-Expression "a:\openssh.ps1 -AutoStart"
- break
- }
-
- if ($rebootMayBeRequired) {
- Write-Host 'These updates may require a reboot'
- $global:RestartRequired=1
- }
-
- Write-Host 'Installing updates...'
-
- $Installer = $script:UpdateSession.CreateUpdateInstaller()
- $Installer.Updates = $UpdatesToInstall
- $InstallationResult = $Installer.Install()
-
- Write-Host "Installation Result: $($InstallationResult.ResultCode)"
- Write-Host "Reboot Required: $($InstallationResult.RebootRequired)"
- Write-Host 'Listing of updates installed and individual installation results:'
- if ($InstallationResult.RebootRequired) {
- $global:RestartRequired=1
- } else {
- $global:RestartRequired=0
- }
-
- for($i=0; $i -lt $UpdatesToInstall.Count; $i++) {
- New-Object -TypeName PSObject -Property @{
- Title = $UpdatesToInstall.Item($i).Title
- Result = $InstallationResult.GetUpdateResult($i).ResultCode
- }
- }
-
- Check-ContinueRestartOrEnd
-}
-
-function Check-WindowsUpdates() {
- Write-Host "Checking For Windows Updates"
- $Username = $env:USERDOMAIN + "\" + $env:USERNAME
-
- New-EventLog -Source $ScriptName -LogName 'Windows Powershell' -ErrorAction SilentlyContinue
-
- $Message = "Script: " + $ScriptPath + "`nScript User: " + $Username + "`nStarted: " + (Get-Date).toString()
-
- Write-EventLog -LogName 'Windows Powershell' -Source $ScriptName -EventID "104" -EntryType "Information" -Message $Message
- Write-Host $Message
-
- $script:UpdateSearcher = $script:UpdateSession.CreateUpdateSearcher()
- $script:SearchResult = $script:UpdateSearcher.Search("IsInstalled=0 and Type='Software' and IsHidden=0")
- if ($SearchResult.Updates.Count -ne 0) {
- $script:SearchResult.Updates |Select-Object -Property Title, Description, SupportUrl, UninstallationNotes, RebootRequired, EulaAccepted |Format-List
- $global:MoreUpdates=1
- } else {
- Write-Host 'There are no applicable updates'
- $global:RestartRequired=0
- $global:MoreUpdates=0
- }
-}
-
-$script:ScriptName = $MyInvocation.MyCommand.ToString()
-$script:ScriptPath = $MyInvocation.MyCommand.Path
-$script:UpdateSession = New-Object -ComObject 'Microsoft.Update.Session'
-$script:UpdateSession.ClientApplicationID = 'Packer Windows Update Installer'
-$script:UpdateSearcher = $script:UpdateSession.CreateUpdateSearcher()
-$script:SearchResult = New-Object -ComObject 'Microsoft.Update.UpdateColl'
-$script:Cycles = 0
-
-Check-WindowsUpdates
-if ($global:MoreUpdates -eq 1) {
- Install-WindowsUpdates
-} else {
- Check-ContinueRestartOrEnd
-}
\ No newline at end of file
diff --git a/packer/scripts/wmf.ps1 b/packer/scripts/wmf.ps1
deleted file mode 100644
index 7846065..0000000
--- a/packer/scripts/wmf.ps1
+++ /dev/null
@@ -1,15 +0,0 @@
-$drive = (Gwmi Win32_mappedLogicalDisk -filter "ProviderName='\\\\vboxsrv\\setup_files'").name
-$wmf_url = "https://download.microsoft.com/download/3/F/D/3FD04B49-26F9-4D9A-8C34-4533B9D5B020/Win8.1AndW2K12R2-KB3066437-x64.msu"
-
-if (!(Test-Path "$drive\Win8.1AndW2K12R2-KB3066437-x64.msu")) {
- Write-Host "Downloading Windows Management Framework 5.0 Preview setup file"
- $wmf_installer = "$env:temp\Win8.1AndW2K12R2-KB3066437-x64.msu"
- (New-Object System.Net.WebClient).DownloadFile($wmf_url, $wmf_installer)
-} else {
- $wmf_installer = "$drive\Win8.1AndW2K12R2-KB3066437-x64.msu"
-}
-Write-Host $wmf_installer
-
-Write-Host "Installing Windows Management Framework 5.0 Preview"
-unblock-file $wmf_installer > $null
-start $wmf_installer @("/quiet", "/norestart") -wait
diff --git a/packer/vagrantfile-windows_2012_r2.template b/packer/vagrantfile-windows_2012_r2.template
deleted file mode 100644
index 1b87dcb..0000000
--- a/packer/vagrantfile-windows_2012_r2.template
+++ /dev/null
@@ -1,45 +0,0 @@
-# -*- mode: ruby -*-
-# vi: set ft=ruby :
-
-Vagrant.require_version ">= 1.6.2"
-
-Vagrant.configure("2") do |config|
- config.vm.define "vagrant-windows-2012"
- config.vm.box = "windows2012r2"
- config.vm.communicator = "winrm"
-
- # Admin user name and password
- config.winrm.username = "vagrant"
- config.winrm.password = "vagrant"
-
- 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.network :forwarded_port, guest: 5985, host: 5985, id: "winrm", auto_correct: true
-
- config.vm.provider :virtualbox do |v, override|
- v.customize ["modifyvm", :id, "--memory", 2048]
- v.customize ["modifyvm", :id, "--cpus", 2]
- v.customize ["modifyvm", :id, "--vram", 64]
- v.customize ["setextradata", "global", "GUI/SuppressMessages", "all" ]
- end
-
- config.vm.provider :vmware_fusion do |v, override|
- v.vmx["memsize"] = "2048"
- v.vmx["numvcpus"] = "2"
- v.vmx["ethernet0.virtualDev"] = "vmxnet3"
- v.vmx["RemoteDisplay.vnc.enabled"] = "false"
- v.vmx["RemoteDisplay.vnc.port"] = "5900"
- v.vmx["scsi0.virtualDev"] = "lsisas1068"
- end
-
- config.vm.provider :vmware_workstation do |v, override|
- v.vmx["memsize"] = "2048"
- v.vmx["numvcpus"] = "2"
- v.vmx["ethernet0.virtualDev"] = "vmxnet3"
- v.vmx["RemoteDisplay.vnc.enabled"] = "false"
- v.vmx["RemoteDisplay.vnc.port"] = "5900"
- v.vmx["scsi0.virtualDev"] = "lsisas1068"
- end
-end