Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

Commit 62306cc

Browse files
v4.10.0
1 parent 0994fbf commit 62306cc

40 files changed

+547
-329
lines changed

Configurations/Implement-Windows-Server-DHCP-2016/VMConfiguration.ps1

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@ Currently on her public DSC hub located here: https://github.com/majst32/DSC_pub
77
88
Additional contributors of note: Jeff Hicks
99
10-
1110
Disclaimer
1211
1312
This example code is provided without copyright and AS IS. It is free for you to use and modify.
14-
Note: These demos should not be run as a script. These are the commands that I use in the
15-
demonstrations and would need to be modified for your environment.
1613
1714
#>
1815

@@ -46,6 +43,18 @@ Import-DSCResource -modulename 'xADCSDeployment' -ModuleVersion '1.4.0.0'
4643

4744
#endregion
4845

46+
#region TLS Settings in registry
47+
48+
registry TLS {
49+
Ensure = "present"
50+
Key = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319'
51+
ValueName = 'SchUseStrongCrypto'
52+
ValueData = '1'
53+
ValueType = 'DWord'
54+
}
55+
56+
#endregion
57+
4958
#region IPaddress settings
5059

5160
If (-not [System.String]::IsNullOrEmpty($node.IPAddress)) {

Configurations/Implement-Windows-Server-DHCP-2016/VMConfigurationData.psd1

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ Updates for DHCP 2016 Course:
1616
Disclaimer
1717
1818
This example code is provided without copyright and AS IS. It is free for you to use and modify.
19-
Note: These demos should not be run as a script. These are the commands that I use in the
20-
demonstrations and would need to be modified for your environment.
2119
2220
#>
2321

@@ -192,22 +190,28 @@ WIN10_x86_Enterprise_LTSC_EN_Eval Windows 10 32bit Enterprise LTSC 2019 En
192190
);
193191
NonNodeData = @{
194192
Lability = @{
195-
# EnvironmentPrefix = 'PS-GUI-' # this will prefix the VM names
193+
194+
# You can uncomment this line to add a prefix to the virtual machine name.
195+
# It will not change the guest computername
196+
# See https://github.com/pluralsight/PS-AutoLab-Env/blob/master/Detailed-Setup-Instructions.md
197+
# for more information.
198+
199+
#EnvironmentPrefix = 'AutoLab-'
196200

197201
Network = @( # Virtual switch in Hyper-V
198202
@{ Name = 'LabNet'; Type = 'Internal'; NetAdapterName = 'Ethernet'; AllowManagementOS = $true; }
199-
);
203+
)
200204
DSCResource = @(
201205
## Download published version from the PowerShell Gallery or Github
202-
@{ Name = 'xActiveDirectory'; RequiredVersion = "3.0.0.0"; Provider = 'PSGallery'; },
203-
@{ Name = 'xComputerManagement'; RequiredVersion = '4.1.0.0'; Provider = 'PSGallery'; },
204-
@{ Name = 'xNetworking'; RequiredVersion = '5.7.0.0'; Provider = 'PSGallery'; },
205-
@{ Name = 'xDhcpServer'; RequiredVersion = '2.0.0.0'; Provider = 'PSGallery'; },
206-
@{ Name = 'xWindowsUpdate' ; RequiredVersion = '2.8.0.0'; Provider = 'PSGallery'; },
207-
@{ Name = 'xPSDesiredStateConfiguration'; RequiredVersion = '9.1.0'; Provider = 'PSGallery'; },
208-
@{ Name = 'xPendingReboot'; RequiredVersion = '0.4.0.0'; Provider = 'PSGallery'; },
209-
@{ Name = 'xADCSDeployment'; RequiredVersion = '1.4.0.0'; Provider = 'PSGallery'; }
210-
);
206+
@{ Name = 'xActiveDirectory'; RequiredVersion = "3.0.0.0"; Provider = 'PSGallery' },
207+
@{ Name = 'xComputerManagement'; RequiredVersion = '4.1.0.0'; Provider = 'PSGallery' },
208+
@{ Name = 'xNetworking'; RequiredVersion = '5.7.0.0'; Provider = 'PSGallery' },
209+
@{ Name = 'xDhcpServer'; RequiredVersion = '2.0.0.0'; Provider = 'PSGallery' },
210+
@{ Name = 'xWindowsUpdate' ; RequiredVersion = '2.8.0.0'; Provider = 'PSGallery' },
211+
@{ Name = 'xPSDesiredStateConfiguration'; RequiredVersion = '9.1.0'; Provider = 'PSGallery' },
212+
@{ Name = 'xPendingReboot'; RequiredVersion = '0.4.0.0'; Provider = 'PSGallery' },
213+
@{ Name = 'xADCSDeployment'; RequiredVersion = '1.4.0.0'; Provider = 'PSGallery' }
214+
)
211215
Resource = @(
212216
@{
213217

@@ -217,8 +221,7 @@ WIN10_x86_Enterprise_LTSC_EN_Eval Windows 10 32bit Enterprise LTSC 2019 En
217221
Expand = $false
218222
#DestinationPath = '\software' # Default is resources folder
219223
}
220-
);
221-
222-
};
223-
};
224-
};
224+
)
225+
}
226+
}
227+
}

Configurations/Implement-Windows-Server-DHCP-2016/VMValidate.test.ps1

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,16 @@ $Secure = ConvertTo-SecureString -String "$($labdata.allnodes.labpassword)" -AsP
99
$Domain = "company"
1010
$cred = New-Object PSCredential "Company\Administrator", $Secure
1111

12+
#The prefix only changes the name of the VM not the guest computername
13+
$prefix = $Labdata.NonNodeData.Lability.EnvironmentPrefix
14+
1215
$all = @()
13-
Describe DC1 {
1416

17+
Describe DC1 {
18+
19+
$VMName = "$($prefix)DC1"
1520
Try {
16-
$dc = New-PSSession -VMName DC1 -Credential $cred -ErrorAction Stop
21+
$dc = New-PSSession -VMName $VMName -Credential $cred -ErrorAction Stop
1722
$all += $dc
1823

1924
#set error action preference to suppress all error messsages
@@ -117,16 +122,18 @@ Describe DC1 {
117122
}
118123
}
119124
Catch {
120-
It "[DC1] Should allow a PSSession" {
125+
It "[DC1] Should allow a PSSession but got error: $($_.exception.message)" {
121126
$false | Should Be $True
122127
}
123128
}
124129
} #DC
125130

126131
Describe S1 {
132+
133+
$VMName = "$($prefix)S1"
127134
Try {
128135

129-
$s1 = New-PSSession -VMName S1 -Credential $cred -ErrorAction Stop
136+
$s1 = New-PSSession -VMName $VMName -Credential $cred -ErrorAction Stop
130137
$all += $s1
131138

132139
#set error action preference to suppress all error messsages
@@ -146,17 +153,18 @@ Describe S1 {
146153
}
147154
}
148155
Catch {
149-
It "[S1] Should allow a PSSession" {
156+
It "[S1] Should allow a PSSession but got error: $($_.exception.message)" {
150157
$false | Should Be $True
151158
}
152159
}
153160
} #S1
154161

155162
Describe Cli1 {
156163

164+
$VMName = "$($prefix)Cli1"
157165
Try {
158166

159-
$cl = New-PSSession -VMName cli1 -Credential $cred -ErrorAction Stop
167+
$cl = New-PSSession -VMName $VMName -Credential $cred -ErrorAction Stop
160168
$all += $cl
161169

162170
#set error action preference to suppress all error messsages
@@ -184,17 +192,19 @@ Describe Cli1 {
184192
}
185193
}
186194
Catch {
187-
It "[CLI1] Should allow a PSSession" {
195+
It "[CLI1] Should allow a PSSession but got error: $($_.exception.message)" {
188196
$false | Should Be $True
189197
}
190198
}
191199
} #cli1
192200

193201
Describe Cli2 {
194202

203+
$VMName = "$($prefix)Cli2"
204+
195205
Try {
196206

197-
$cl2 = New-PSSession -VMName cli2 -Credential $cred -ErrorAction Stop
207+
$cl2 = New-PSSession -VMName $VMName -Credential $cred -ErrorAction Stop
198208
$all += $cl2
199209

200210
#set error action preference to suppress all error messsages
@@ -214,7 +224,7 @@ Describe Cli2 {
214224
}
215225
}
216226
Catch {
217-
It "[CLI2] Should allow a PSSession" {
227+
It "[CLI2] Should allow a PSSession but got error: $($_.exception.message)" {
218228
$false | Should Be $True
219229
}
220230
}

Configurations/Jason-DSC-Env/VMConfiguration.ps1

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,9 @@ Currently on her public DSC hub located here: https://github.com/majst32/DSC_pub
77
88
Additional contributors of note: Jeff Hicks
99
10-
1110
Disclaimer
1211
1312
This example code is provided without copyright and AS IS. It is free for you to use and modify.
14-
Note: These demos should not be run as a script. These are the commands that I use in the
15-
demonstrations and would need to be modified for your environment.
16-
1713
#>
1814

1915
Configuration AutoLab {
@@ -47,8 +43,20 @@ Configuration AutoLab {
4743
}
4844

4945
#endregion
50-
#region IPaddress settings
5146

47+
#region TLS Settings in registry
48+
49+
registry TLS {
50+
Ensure = "present"
51+
Key = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319'
52+
ValueName = 'SchUseStrongCrypto'
53+
ValueData = '1'
54+
ValueType = 'DWord'
55+
}
56+
57+
#endregion
58+
59+
#region IPaddress settings
5260

5361
If (-not [System.String]::IsNullOrEmpty($node.IPAddress)) {
5462
xIPAddress 'PrimaryIPAddress' {

Configurations/Jason-DSC-Env/VMConfigurationData.psd1

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@ Currently on her public DSC hub located here: https://github.com/majst32/DSC_pub
77
88
Additional contributors of note: Jeff Hicks
99
10-
1110
Disclaimer
1211
1312
This example code is provided without copyright and AS IS. It is free for you to use and modify.
14-
Note: These demos should not be run as a script. These are the commands that I use in the
15-
demonstrations and would need to be modified for your environment.
1613
1714
#>
1815

@@ -192,26 +189,32 @@ demonstrations and would need to be modified for your environment.
192189
CustomBootStrap = ''
193190
}
194191

195-
);
192+
)
196193
NonNodeData = @{
197194
Lability = @{
198-
# EnvironmentPrefix = 'PS-GUI-' # this will prefix the VM names
195+
196+
# You can uncomment this line to add a prefix to the virtual machine name.
197+
# It will not change the guest computername
198+
# See https://github.com/pluralsight/PS-AutoLab-Env/blob/master/Detailed-Setup-Instructions.md
199+
# for more information.
200+
201+
#EnvironmentPrefix = 'AutoLab-'
199202

200203
Network = @( # Virtual switch in Hyper-V
201-
@{ Name = 'LabNet'; Type = 'Internal'; NetAdapterName = 'Ethernet'; AllowManagementOS = $true; }
204+
@{ Name = 'LabNet'; Type = 'Internal'; NetAdapterName = 'Ethernet'; AllowManagementOS = $true }
202205
);
203206
DSCResource = @(
204207
## Download published version from the PowerShell Gallery or Github
205-
@{ Name = 'xActiveDirectory'; RequiredVersion = "3.0.0.0"; Provider = 'PSGallery'; },
206-
@{ Name = 'xComputerManagement'; RequiredVersion = '4.1.0.0'; Provider = 'PSGallery'; },
207-
@{ Name = 'xNetworking'; RequiredVersion = '5.7.0.0'; Provider = 'PSGallery'; },
208-
@{ Name = 'xDhcpServer'; RequiredVersion = '2.0.0.0'; Provider = 'PSGallery'; },
209-
@{ Name = 'xWindowsUpdate' ; RequiredVersion = '2.8.0.0'; Provider = 'PSGallery'; },
210-
@{ Name = 'xPSDesiredStateConfiguration'; RequiredVersion = '9.1.0'; Provider = 'PSGallery'; },
211-
@{ Name = 'xPendingReboot'; RequiredVersion = '0.4.0.0'; Provider = 'PSGallery'; },
212-
@{ Name = 'xADCSDeployment'; RequiredVersion = '1.4.0.0'; Provider = 'PSGallery'; }
208+
@{ Name = 'xActiveDirectory'; RequiredVersion = "3.0.0.0"; Provider = 'PSGallery' },
209+
@{ Name = 'xComputerManagement'; RequiredVersion = '4.1.0.0'; Provider = 'PSGallery' },
210+
@{ Name = 'xNetworking'; RequiredVersion = '5.7.0.0'; Provider = 'PSGallery' },
211+
@{ Name = 'xDhcpServer'; RequiredVersion = '2.0.0.0'; Provider = 'PSGallery' },
212+
@{ Name = 'xWindowsUpdate' ; RequiredVersion = '2.8.0.0'; Provider = 'PSGallery' },
213+
@{ Name = 'xPSDesiredStateConfiguration'; RequiredVersion = '9.1.0'; Provider = 'PSGallery' },
214+
@{ Name = 'xPendingReboot'; RequiredVersion = '0.4.0.0'; Provider = 'PSGallery' },
215+
@{ Name = 'xADCSDeployment'; RequiredVersion = '1.4.0.0'; Provider = 'PSGallery' }
213216

214-
);
217+
)
215218
Resource = @(
216219
@{
217220
Id = 'Win10RSAT'
@@ -220,8 +223,7 @@ demonstrations and would need to be modified for your environment.
220223
Expand = $false
221224
#DestinationPath = '\software' # Default is resources folder
222225
}
223-
);
224-
225-
};
226-
};
227-
};
226+
)
227+
}
228+
}
229+
}

Configurations/Jason-DSC-Env/VMValidate.test.ps1

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,15 @@ $Secure = ConvertTo-SecureString -String "$($labdata.allnodes.labpassword)" -AsP
99
$Domain = "company"
1010
$cred = New-Object PSCredential "Company\Administrator", $Secure
1111

12+
#The prefix only changes the name of the VM not the guest computername
13+
$prefix = $Labdata.NonNodeData.Lability.EnvironmentPrefix
14+
15+
1216
$all = @()
1317
Describe DC1 {
14-
18+
$VMName = "$($prefix)DC1"
1519
Try {
16-
$dc = New-PSSession -VMName DC1 -Credential $cred -ErrorAction Stop
20+
$dc = New-PSSession -VMName $VMName -Credential $cred -ErrorAction Stop
1721
$all += $dc
1822
#set error action preference to suppress all error messsages
1923
Invoke-Command { $errorActionPreference = 'silentlyContinue'} -session $dc
@@ -116,15 +120,18 @@ Describe DC1 {
116120
}
117121
}
118122
Catch {
119-
It "[DC1] Should allow a PSSession" {
123+
It "[DC1] Should allow a PSSession but got error: $($_.exception.message)" {
120124
$false | Should Be $True
121125
}
122126
}
123127
} #DC
124128

125129
Describe S1 {
130+
131+
$VMName = "$($prefix)S1"
132+
126133
Try {
127-
$s1 = New-PSSession -VMName S1 -Credential $cred -ErrorAction Stop
134+
$s1 = New-PSSession -VMName $VMName -Credential $cred -ErrorAction Stop
128135
$all += $s1
129136

130137
#set error action preference to suppress all error messsages
@@ -143,15 +150,17 @@ Describe S1 {
143150
}
144151
}
145152
Catch {
146-
It "[S1] Should allow a PSSession" {
153+
It "[S1] Should allow a PSSession but got error: $($_.exception.message)" {
147154
$false | Should Be $True
148155
}
149156
}
150157
} #S1
151158

152159
Describe S2 {
160+
161+
$VMName = "$($prefix)S2"
153162
Try {
154-
$s2 = New-PSSession -VMName S2 -Credential $cred -ErrorAction Stop
163+
$s2 = New-PSSession -VMName $VMName -Credential $cred -ErrorAction Stop
155164
$all += $s2
156165
#set error action preference to suppress all error messsages
157166
Invoke-Command { $errorActionPreference = 'silentlyContinue'} -session $s2
@@ -169,15 +178,17 @@ Describe S2 {
169178
}
170179
}
171180
Catch {
172-
It "[S2] Should allow a PSSession" {
181+
It "[S2] Should allow a PSSession but got error: $($_.exception.message)" {
173182
$false | Should Be $True
174183
}
175184
}
176185
} #S2
177186

178187
Describe PullServer {
188+
189+
$VMName = "$($prefix)PullServer"
179190
Try {
180-
$PullServer = New-PSSession -VMName PullServer -Credential $cred -ErrorAction Stop
191+
$PullServer = New-PSSession -VMName $VMName -Credential $cred -ErrorAction Stop
181192
$all += $PullServer
182193
#set error action preference to suppress all error messsages
183194
Invoke-Command { $errorActionPreference = 'silentlyContinue'} -session $pullserver
@@ -203,8 +214,9 @@ Describe PullServer {
203214

204215
Describe Cli1 {
205216

217+
$VMName = "$($prefix)Cli1"
206218
Try {
207-
$cl = New-PSSession -VMName cli1 -Credential $cred -ErrorAction Stop
219+
$cl = New-PSSession -VMName $VMName -Credential $cred -ErrorAction Stop
208220
$all += $cl
209221
#set error action preference to suppress all error messsages
210222
Invoke-Command { $errorActionPreference = 'silentlyContinue'} -session $cl
@@ -229,7 +241,7 @@ Describe Cli1 {
229241
}
230242
}
231243
Catch {
232-
It "[CLI1] Should allow a PSSession" {
244+
It "[CLI1] Should allow a PSSession but got error: $($_.exception.message)" {
233245
$false | Should Be $True
234246
}
235247
}

0 commit comments

Comments
 (0)