From a7eef3e9f714e773fc0e7255a7ff0b48f077b62b Mon Sep 17 00:00:00 2001 From: Abir Majumdar Date: Tue, 19 Feb 2019 17:17:24 -0500 Subject: [PATCH] Update windows_baseline.pp --- site/profile/manifests/windows_baseline.pp | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/site/profile/manifests/windows_baseline.pp b/site/profile/manifests/windows_baseline.pp index be7bbdb..7e27f6e 100644 --- a/site/profile/manifests/windows_baseline.pp +++ b/site/profile/manifests/windows_baseline.pp @@ -44,5 +44,50 @@ class profile::windows_baseline { type => dword, data => '0xFFFFFFFF', } + + if versioncmp($::powershell_version, '5.1.0') <= 0 { + #notify{"version was less than":} + + # service needs to be running to install the update + service { 'wuauserv': + ensure => 'running', + enable => true, + } + + # disable auto updating so machine doesnt start downloading / updating + registry::value { 'disable updates': + key => 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU', + value => 'NoAutoUpdate', + data => '1', + type => 'dword', + } + + # Get WMF + package { 'powershell': + ensure => latest, + #install_options => ['-pre','--ignore-package-exit-codes'], + provider => chocolatey, + } + + reboot {'dsc_install': + subscribe => Package['powershell'], + apply => 'immediately', + timeout => 0, + } + + } + + registry::value { 'enable insecure winrm': + key => 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service', + value => 'AllowUnencryptedTraffic', + data => '1', + type => 'dword', + notify => Service['WinRM'], + } + + service {'WinRM': + ensure => 'running', + enable => true, + } }