From d7b15bde69e5860194a1530943101771b5648af8 Mon Sep 17 00:00:00 2001 From: Adam Haydon Date: Tue, 21 May 2019 11:52:48 +0100 Subject: [PATCH] Fix for large downloads (#83) * remove packer files * fix for large downloads --- .gitignore | 7 +- Qlik-Cli.psd1 | 2 +- functions/core.ps1 | 18 +- packer/2012r2-virtualbox.json | 206 ------------ packer/LICENSE | 22 -- packer/README.md | 30 -- packer/answer_files/2012_r2/Autounattend.xml | 305 ------------------ .../2012_r2/Autounattend_sysprep.xml | 62 ---- packer/scripts/cleanup.ps1 | 49 --- packer/scripts/compile-dotnet-assemblies.bat | 17 - packer/scripts/dis-updates.ps1 | 30 -- packer/scripts/disable-auto-logon.bat | 1 - .../scripts/disable-password-complexity.ps1 | 8 - packer/scripts/dotnet.ps1 | 19 -- packer/scripts/enable-rdp.bat | 2 - packer/scripts/microsoft-updates.bat | 12 - packer/scripts/oracle-cert.cer | Bin 1419 -> 0 bytes packer/scripts/virtualbox-guest-tools.ps1 | 16 - packer/scripts/win-updates.ps1 | 170 ---------- packer/scripts/wmf.ps1 | 15 - packer/vagrantfile-windows_2012_r2.template | 45 --- 21 files changed, 20 insertions(+), 1016 deletions(-) delete mode 100644 packer/2012r2-virtualbox.json delete mode 100644 packer/LICENSE delete mode 100644 packer/README.md delete mode 100644 packer/answer_files/2012_r2/Autounattend.xml delete mode 100644 packer/answer_files/2012_r2/Autounattend_sysprep.xml delete mode 100644 packer/scripts/cleanup.ps1 delete mode 100644 packer/scripts/compile-dotnet-assemblies.bat delete mode 100644 packer/scripts/dis-updates.ps1 delete mode 100644 packer/scripts/disable-auto-logon.bat delete mode 100644 packer/scripts/disable-password-complexity.ps1 delete mode 100644 packer/scripts/dotnet.ps1 delete mode 100644 packer/scripts/enable-rdp.bat delete mode 100644 packer/scripts/microsoft-updates.bat delete mode 100644 packer/scripts/oracle-cert.cer delete mode 100644 packer/scripts/virtualbox-guest-tools.ps1 delete mode 100644 packer/scripts/win-updates.ps1 delete mode 100644 packer/scripts/wmf.ps1 delete mode 100644 packer/vagrantfile-windows_2012_r2.template 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</PlainText> - </Password> - <Enabled>true</Enabled> - <Username>vagrant</Username> - </AutoLogon> - <FirstLogonCommands> - <SynchronousCommand wcm:action="add"> - <CommandLine>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy Bypass -Force"</CommandLine> - <Description>Set Execution Policy 64 Bit</Description> - <Order>1</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy Bypass -Force"</CommandLine> - <Description>Set Execution Policy 32 Bit</Description> - <Order>2</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>cmd.exe /c winrm quickconfig -q</CommandLine> - <Description>winrm quickconfig -q</Description> - <Order>3</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>cmd.exe /c winrm quickconfig -transport:http</CommandLine> - <Description>winrm quickconfig -transport:http</Description> - <Order>4</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>cmd.exe /c winrm set winrm/config @{MaxTimeoutms="1800000"}</CommandLine> - <Description>Win RM MaxTimoutms</Description> - <Order>5</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>cmd.exe /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="512"}</CommandLine> - <Description>Win RM MaxMemoryPerShellMB</Description> - <Order>6</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>cmd.exe /c winrm set winrm/config/service @{AllowUnencrypted="true"}</CommandLine> - <Description>Win RM AllowUnencrypted</Description> - <Order>7</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>cmd.exe /c winrm set winrm/config/service/auth @{Basic="true"}</CommandLine> - <Description>Win RM auth Basic</Description> - <Order>8</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>cmd.exe /c winrm set winrm/config/client/auth @{Basic="true"}</CommandLine> - <Description>Win RM client auth Basic</Description> - <Order>9</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>cmd.exe /c winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"} </CommandLine> - <Description>Win RM listener Address/Port</Description> - <Order>10</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>cmd.exe /c netsh advfirewall firewall set rule group="remote administration" new enable=yes </CommandLine> - <Description>Win RM adv firewall enable</Description> - <Order>11</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>cmd.exe /c netsh firewall add portopening TCP 5985 "Port 5985" </CommandLine> - <Description>Win RM port open</Description> - <Order>12</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> -<!-- <SynchronousCommand wcm:action="add"> - <CommandLine>cmd.exe /c net stop winrm </CommandLine> - <Description>Stop Win RM Service </Description> - <Order>13</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>cmd.exe /c sc config winrm start= auto</CommandLine> - <Description>Win RM Autostart</Description> - <Order>14</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>cmd.exe /c net start winrm</CommandLine> - <Description>Start Win RM Service</Description> - <Order>15</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - --> - <SynchronousCommand wcm:action="add"> - <CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v HideFileExt /t REG_DWORD /d 0 /f</CommandLine> - <Order>16</Order> - <Description>Show file extensions in Explorer</Description> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\Console /v QuickEdit /t REG_DWORD /d 1 /f</CommandLine> - <Order>17</Order> - <Description>Enable QuickEdit mode</Description> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v Start_ShowRun /t REG_DWORD /d 1 /f</CommandLine> - <Order>18</Order> - <Description>Show Run command in Start Menu</Description> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v StartMenuAdminTools /t REG_DWORD /d 1 /f</CommandLine> - <Order>19</Order> - <Description>Show Administrative Tools in Start Menu</Description> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>%SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateFileSizePercent /t REG_DWORD /d 0 /f</CommandLine> - <Order>20</Order> - <Description>Zero Hibernation File</Description> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>%SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateEnabled /t REG_DWORD /d 0 /f</CommandLine> - <Order>21</Order> - <Description>Disable Hibernation Mode</Description> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE</CommandLine> - <Order>22</Order> - <Description>Disable password expiration for vagrant user</Description> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>cmd.exe /c powershell -File a:\disable-password-complexity.ps1</CommandLine> - <Description>Disable password complexity</Description> - <Order>23</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - <!-- WITHOUT WINDOWS UPDATES - - <SynchronousCommand wcm:action="add"> - <CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\openssh.ps1 -AutoStart</CommandLine> - <Description>Install OpenSSH</Description> - <Order>99</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - --> - - <!-- END WITHOUT WINDOWS UPDATES --> - <!-- WITH WINDOWS UPDATES - <SynchronousCommand wcm:action="add"> - <CommandLine>cmd.exe /c a:\microsoft-updates.bat</CommandLine> - <Order>98</Order> - <Description>Enable Microsoft Updates</Description> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\win-updates.ps1</CommandLine> - <Description>Install Windows Updates</Description> - <Order>100</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - --> - <!-- END WITH WINDOWS UPDATES --> - </FirstLogonCommands> - <OOBE> - <HideEULAPage>true</HideEULAPage> - <HideLocalAccountScreen>true</HideLocalAccountScreen> - <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> - <HideOnlineAccountScreens>true</HideOnlineAccountScreens> - <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> - <NetworkLocation>Home</NetworkLocation> - <ProtectYourPC>1</ProtectYourPC> - </OOBE> - <UserAccounts> - <AdministratorPassword> - <Value>vagrant</Value> - <PlainText>true</PlainText> - </AdministratorPassword> - <LocalAccounts> - <LocalAccount wcm:action="add"> - <Password> - <Value>vagrant</Value> - <PlainText>true</PlainText> - </Password> - <Group>administrators</Group> - <DisplayName>Vagrant</DisplayName> - <Name>vagrant</Name> - <Description>Vagrant User</Description> - </LocalAccount> - </LocalAccounts> - </UserAccounts> - <RegisteredOwner/> - </component> - </settings> - <settings pass="offlineServicing"> - <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-LUA-Settings" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> - <EnableLUA>false</EnableLUA> - </component> - </settings> - <cpi:offlineImage xmlns:cpi="urn:schemas-microsoft-com:cpi" cpi:source="wim:c:/wim/install.wim#Windows Server 2012 R2 SERVERSTANDARD"/> -</unattend> 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 @@ -<?xml version="1.0" encoding="utf-8"?> -<unattend xmlns="urn:schemas-microsoft-com:unattend"> - <settings pass="generalize"> - <component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <SkipRearm>1</SkipRearm> - </component> - <component name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <PersistAllDeviceInstalls>false</PersistAllDeviceInstalls> - <DoNotCleanUpNonPresentDevices>false</DoNotCleanUpNonPresentDevices> - </component> - </settings> - <settings pass="oobeSystem"> - <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <InputLocale>en-GB</InputLocale> - <SystemLocale>en-GB</SystemLocale> - <UILanguage>en-US</UILanguage> - <UserLocale>en-GB</UserLocale> - </component> - <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <OOBE> - <HideEULAPage>true</HideEULAPage> - <ProtectYourPC>1</ProtectYourPC> - <NetworkLocation>Work</NetworkLocation> - <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> - </OOBE> - <UserAccounts> - <AdministratorPassword> - <Value>vagrant</Value> - <PlainText>true</PlainText> - </AdministratorPassword> - <LocalAccounts> - <LocalAccount wcm:action="add"> - <Password> - <Value>vagrant</Value> - <PlainText>true</PlainText> - </Password> - <Group>administrators</Group> - <DisplayName>Vagrant</DisplayName> - <Name>vagrant</Name> - <Description>Vagrant User</Description> - </LocalAccount> - </LocalAccounts> - </UserAccounts> - <TimeZone>UTC</TimeZone> - <!--<FirstLogonCommands> - <SynchronousCommand wcm:action="add"> - <CommandLine>cmd /c c:\"Program Files"\OpenSSH\uninstall.exe /S</CommandLine> - <Description>Uninstall OpenSSH</Description> - <Order>99</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - </FirstLogonCommands>--> - </component> - </settings> - <settings pass="specialize"> - <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <!--<ComputerName>windows2012r2-vagrant</ComputerName> - <CopyProfile>false</CopyProfile>--> - <ProductKey>XXXXX-XXXXX-XXXXX-XXXXX-XXXXX</ProductKey> - </component> - </settings> -</unattend> \ 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 <paramName> - 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 abb6ee6358d80de0ced2d1143b50476430a3cbf6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1419 zcmXqLVr@5QV#!~?%*4pVBoKItVTRb>y$v4~9*DjxZL%}qW#iOp^Jx3d%gD&e%3#pA z#gN;8lZ`o)g-w_#G}utwKorE`66Om_Ey@heOwZF%@XSlrGn6-w1xauVi@_umLW)X@ zOBDQ4OUm<$vJI^bEFlVvLQ;!zixu+I6iSOz6%tDnGD=DcimmkZ%gf94%7CU815MRS z&d=2^Do9k&NY*qoFw`^90cmCyR)w4HoRe5wtYEC*oS%}a0CGrXUb=#jfuVtdv!j8W zIIp3xp^=fX0T@I9xn@8vP{7pE)H2GT@f51Jgbf5i=5q*hIVa|1rsWsqWhTP>$}Y?o zl$uhWpP!--oRMFYT5Kq7APG{<B_iZsl$e~83UotJL4HwUNoIbYp`C#Z#Gj@vndzA& zi8%_ME($Qm>MHnVCKu%w=ckn@1Otik#G+J%FrbwwV9g3;Mut$QaEow-Wfql`CgwQh zSHNs!#%7~I6QdGxv@x<WFgG#sGXTZ8n3@<F8Sb#CpWS8g-K3OjMcd~WA6{j*E%~Oa zZ@r-8r<TH&#aABfs&V?6$WmxkrQdVh?aYc-+0PlQE?!kWytL6ZU*hk%GNIldlP(y1 zxOe(~vS(DOwYfs({f+l*=h&X@{XR!6rq?)QPlsmt{x4Ra{2Sh;6$i5yma81_oAJF< zJ$&Ys#~o8ymSh?0Y8A)-HM+Scy`?RP<=D^Z83L;gdrW&QTGTD-upxZ)shiCDDd*K? z&MY-#eDg48O|NbLmL<=-*Y-}9pSJM7{hUQFUp<`h+(9LxMIuYt_9@TWovVBHo{N`0 znSW?uoP5BxJy#O{rM@<`SjQ_{cXH0N@BCMGgiM)bzRqIf{xz4ynV1<F7#BA&Rs%z% z9GsYCg;|&k7!3G;5hcsd$oQXyg_()H!N38;muImwFgGw=V7$PvO&^prfhjY&IN4Yi zl(uw}i*iuYsB^G0L`n}RW#9rbL4n2A0F>If6WTl&+kUt*vWqhtXc=g*acHvvGZi}% zqnHf7G;bgbGDVez$AAl_g_+r)5XNR?WJxthHc)}_4H(-bpzh31E-pZEo`E%76%!WU zBxWX}DAz~wO=^*WJjfl&ED{D{4I<}fu6$Lk_Qm^TU;p(FtZMHcUs^sFm}xj6eslsl z3K)hg0tRAiTtHv4FgBSpF-o&=7_b2oATWfH6DY7;0VYsJhJ{CX_qnNbZ3^0b(#!PZ z-f#a8WbfTMDbzTnH)D<x+lvYI)AePhT(o9SIl0kp!<`@U@4D0q=B_-zZSeF*W5kKI zr;2VHvOJc&%^tjE)5%9duJ4{Uyk77r_E?I&j_LVG_TPHenhSTw^M>*?oIJhvLs{m| z{^e!vdd3e8dw)bqJq!8Nmc}$w=A+Fln>LN<x#7$2DsuXSMcA2qUv|f&`=?~?!<Q_+ z-&wD2J;45--B8*x?rP0`ms334=RH$a7_aORZ2h(<d&TS{OGJLJ)1TPyUD>hHxLr5= z{h8+mRuQkCvT(G1f4S$&-*?x3Y`WgLUh(6-E2(T7|DIX@V|sqny?IJ;mXD8q1pvu- B@Du<5 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