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

Commit dd85a3e

Browse files
v4.7.0
1 parent 10a5048 commit dd85a3e

21 files changed

+233
-113
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ $credential = New-Object -typename Pscredential -ArgumentList Administrator, $se
2424

2525
#region DSC Resources
2626
Import-DSCresource -ModuleName "PSDesiredStateConfiguration" -ModuleVersion "1.1"
27-
Import-DSCResource -modulename "xPSDesiredStateConfiguration" -ModuleVersion "9.0.0"
27+
Import-DSCResource -modulename "xPSDesiredStateConfiguration" -ModuleVersion "9.1.0"
2828
Import-DSCResource -modulename "xActiveDirectory" -ModuleVersion "3.0.0.0"
2929
Import-DSCResource -modulename "xComputerManagement" -ModuleVersion "4.1.0.0"
3030
Import-DSCResource -modulename "xNetworking" -ModuleVersion "5.7.0.0"
@@ -48,7 +48,6 @@ Import-DSCResource -modulename 'xADCSDeployment' -ModuleVersion '1.4.0.0'
4848

4949
#region IPaddress settings
5050

51-
5251
If (-not [System.String]::IsNullOrEmpty($node.IPAddress)) {
5352
xIPAddress 'PrimaryIPAddress' {
5453
IPAddress = $node.IPAddress

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ WIN10_x86_Enterprise_LTSC_EN_Eval Windows 10 32bit Enterprise LTSC 2019 En
204204
@{ Name = 'xNetworking'; RequiredVersion = '5.7.0.0'; Provider = 'PSGallery'; },
205205
@{ Name = 'xDhcpServer'; RequiredVersion = '2.0.0.0'; Provider = 'PSGallery'; },
206206
@{ Name = 'xWindowsUpdate' ; RequiredVersion = '2.8.0.0'; Provider = 'PSGallery'; },
207-
@{ Name = 'xPSDesiredStateConfiguration'; RequiredVersion = '9.0.0'; Provider = 'PSGallery'; },
207+
@{ Name = 'xPSDesiredStateConfiguration'; RequiredVersion = '9.1.0'; Provider = 'PSGallery'; },
208208
@{ Name = 'xPendingReboot'; RequiredVersion = '0.4.0.0'; Provider = 'PSGallery'; },
209209
@{ Name = 'xADCSDeployment'; RequiredVersion = '1.4.0.0'; Provider = 'PSGallery'; }
210210
);

Configurations/Jason-DSC-Env/VMConfiguration.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Configuration AutoLab {
2929
Import-DSCResource -ModuleName 'xNetworking' -ModuleVersion '5.7.0.0'
3030
Import-DSCResource -ModuleName 'xDhcpServer' -ModuleVersion '2.0.0.0'
3131
Import-DSCResource -ModuleName 'xWindowsUpdate' -ModuleVersion '2.8.0.0'
32-
Import-DSCResource -ModuleName 'xPSDesiredStateConfiguration' -ModuleVersion '9.0.0'
32+
Import-DSCResource -ModuleName 'xPSDesiredStateConfiguration' -ModuleVersion '9.1.0'
3333
Import-DSCResource -ModuleName 'xPendingReboot' -ModuleVersion '0.4.0.0'
3434
Import-DSCResource -ModuleName 'xADCSDeployment' -ModuleVersion '1.4.0.0'
3535

Configurations/Jason-DSC-Env/VMConfigurationData.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ demonstrations and would need to be modified for your environment.
207207
@{ Name = 'xNetworking'; RequiredVersion = '5.7.0.0'; Provider = 'PSGallery'; },
208208
@{ Name = 'xDhcpServer'; RequiredVersion = '2.0.0.0'; Provider = 'PSGallery'; },
209209
@{ Name = 'xWindowsUpdate' ; RequiredVersion = '2.8.0.0'; Provider = 'PSGallery'; },
210-
@{ Name = 'xPSDesiredStateConfiguration'; RequiredVersion = '9.0.0'; Provider = 'PSGallery'; },
210+
@{ Name = 'xPSDesiredStateConfiguration'; RequiredVersion = '9.1.0'; Provider = 'PSGallery'; },
211211
@{ Name = 'xPendingReboot'; RequiredVersion = '0.4.0.0'; Provider = 'PSGallery'; },
212212
@{ Name = 'xADCSDeployment'; RequiredVersion = '1.4.0.0'; Provider = 'PSGallery'; }
213213

Configurations/MultiRole/VMConfiguration.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ $credential = New-Object -typename Pscredential -ArgumentList Administrator, $se
88

99
#region DSC Resources
1010
Import-DSCresource -ModuleName "PSDesiredStateConfiguration" -ModuleVersion "1.1"
11-
Import-DSCResource -modulename "xPSDesiredStateConfiguration" -ModuleVersion "9.0.0"
11+
Import-DSCResource -modulename "xPSDesiredStateConfiguration" -ModuleVersion "9.1.0"
1212
Import-DSCResource -modulename "xActiveDirectory" -ModuleVersion "3.0.0.0"
1313
Import-DSCResource -modulename "xComputerManagement" -ModuleVersion "4.1.0.0"
1414
Import-DSCResource -modulename "xNetworking" -ModuleVersion "5.7.0.0"

Configurations/MultiRole/VMConfigurationData.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ demonstrations and would need to be modified for your environment.
197197
@{ Name = 'xNetworking'; RequiredVersion = '5.7.0.0'; Provider = 'PSGallery'; },
198198
@{ Name = 'xDhcpServer'; RequiredVersion = '2.0.0.0'; Provider = 'PSGallery'; },
199199
@{ Name = 'xWindowsUpdate' ; RequiredVersion = '2.8.0.0'; Provider = 'PSGallery'; },
200-
@{ Name = 'xPSDesiredStateConfiguration'; RequiredVersion = '9.0.0'; },
200+
@{ Name = 'xPSDesiredStateConfiguration'; RequiredVersion = '9.1.0'; },
201201
@{ Name = 'xPendingReboot'; RequiredVersion = '0.4.0.0'; Provider = 'PSGallery'; },
202202
@{ Name = 'xADCSDeployment'; RequiredVersion = '1.4.0.0'; Provider = 'PSGallery'; },
203203
@{ Name = 'xDnsServer'; RequiredVersion = "1.16.0.0"; Provider = 'PSGallery'; }

Configurations/PowerShellLab/VMConfiguration.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Configuration AutoLab {
2424

2525
#region DSC Resources
2626
Import-DSCresource -ModuleName "PSDesiredStateConfiguration" -ModuleVersion "1.1"
27-
Import-DSCResource -modulename "xPSDesiredStateConfiguration" -ModuleVersion "9.0.0"
27+
Import-DSCResource -modulename "xPSDesiredStateConfiguration" -ModuleVersion "9.1.0"
2828
Import-DSCResource -modulename "xActiveDirectory" -ModuleVersion "3.0.0.0"
2929
Import-DSCResource -modulename "xComputerManagement" -ModuleVersion "4.1.0.0"
3030
Import-DSCResource -modulename "xNetworking" -ModuleVersion "5.7.0.0"

Configurations/PowerShellLab/VMConfigurationData.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ demonstrations and would need to be modified for your environment.
203203
@{ Name = 'xNetworking'; RequiredVersion = '5.7.0.0'; Provider = 'PSGallery'; },
204204
@{ Name = 'xDhcpServer'; RequiredVersion = '2.0.0.0'; Provider = 'PSGallery'; },
205205
@{ Name = 'xWindowsUpdate' ; RequiredVersion = '2.8.0.0'; Provider = 'PSGallery'; },
206-
@{ Name = 'xPSDesiredStateConfiguration'; RequiredVersion = '9.0.0'; },
206+
@{ Name = 'xPSDesiredStateConfiguration'; RequiredVersion = '9.1.0'; },
207207
@{ Name = 'xPendingReboot'; RequiredVersion = '0.4.0.0'; Provider = 'PSGallery'; },
208208
@{ Name = 'xADCSDeployment'; RequiredVersion = '1.4.0.0'; Provider = 'PSGallery'; },
209209
@{ Name = 'xDnsServer'; RequiredVersion = "1.16.0.0"; Provider = 'PSGallery'; },

Configurations/PowerShellLab/VMValidate.test.ps1

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Describe DOM1 {
2727
}
2828

2929
It "[DOM1] Should belong to the COMPANY domain" {
30-
$test = Invoke-Command { Get-Ciminstance -ClassName win32_computersystem -property domain } -session $DC
30+
$test = Invoke-Command { Get-CimInstance -ClassName win32_computersystem -property domain } -session $DC
3131
$test.domain | Should Be "company.pri"
3232
}
3333

@@ -42,16 +42,16 @@ Describe DOM1 {
4242
}
4343

4444
It "[DOM1] Should have an IP address of 192.168.3.10" {
45-
$i = Invoke-command -ScriptBlock { Get-NetIPAddress -interfacealias 'Ethernet' -AddressFamily IPv4 } -Session $dc
46-
$i.ipv4Address | should be '192.168.3.10'
45+
$i = Invoke-Command -ScriptBlock { Get-NetIPAddress -interfacealias 'Ethernet' -AddressFamily IPv4 } -Session $dc
46+
$i.ipv4Address | Should be '192.168.3.10'
4747
}
4848

4949
It "[DOM1] Should have a domain name of $domain" {
50-
$r = Invoke-command { Get-ADDomain -ErrorAction SilentlyContinue } -session $dc
51-
$r.name | should Be $domain
50+
$r = Invoke-Command { Get-ADDomain -ErrorAction SilentlyContinue } -session $dc
51+
$r.name | Should Be $domain
5252
}
5353

54-
$OUs = Invoke-command { Get-ADorganizationalUnit -filter * -ErrorAction SilentlyContinue } -session $dc
54+
$OUs = Invoke-Command { Get-ADOrganizationalUnit -filter * -ErrorAction SilentlyContinue } -session $dc
5555
$needed = 'IT', 'Dev', 'Marketing', 'Sales', 'Accounting', 'JEA_Operators', 'Servers'
5656
foreach ($item in $needed) {
5757
It "[DOM1] Should have organizational unit $item" {
@@ -68,9 +68,9 @@ Describe DOM1 {
6868

6969
}
7070

71-
$users = Invoke-Command { Get-AdUser -filter * -ErrorAction SilentlyContinue } -session $dc
71+
$users = Invoke-Command { Get-ADUser -filter * -ErrorAction SilentlyContinue } -session $dc
7272
It "[DOM1] Should have at least 15 user accounts" {
73-
$users.count | should BeGreaterThan 15
73+
$users.count | Should BeGreaterThan 15
7474
}
7575

7676
$admins = Invoke-Command { Get-ADGroupMember "Domain Admins"-ErrorAction SilentlyContinue } -session $dc
@@ -95,14 +95,14 @@ Describe DOM1 {
9595
$computer.name -contains "SRV2" | Should Be "True"
9696
}
9797

98-
$rec = Invoke-command { Resolve-DNSName Srv3.company.pri } -session $DC
98+
$rec = Invoke-Command { Resolve-DnsName Srv3.company.pri } -session $DC
9999
It "[DOM1] Should have a DNS record for SRV3.COMPANY.PRI" {
100100
$rec.name | Should be 'srv3.company.pri'
101101
$rec.ipaddress | Should be '192.168.3.60'
102102
}
103103

104104
It "[DOM1] Should be running Windows Server 2016" {
105-
$test = Invoke-Command { Get-Ciminstance -ClassName win32_operatingsystem -property caption } -session $dc
105+
$test = Invoke-Command { Get-CimInstance -ClassName win32_operatingsystem -property caption } -session $dc
106106
$test.caption | Should BeLike '*2016*'
107107
}
108108
} #DOM1
@@ -113,25 +113,25 @@ Describe SRV1 {
113113
$all += $srv1
114114
}
115115
Catch {
116-
Write-Warning "Failed to create PSSession to DOM1. $($_.exception.message)"
116+
Write-Warning "Failed to create PSSession to SRV1. $($_.exception.message)"
117117
#bail out of the test
118118
Return
119119
} It "[SRV1] Should belong to the COMPANY domain" {
120-
$test = Invoke-Command { Get-Ciminstance -ClassName win32_computersystem -property domain } -session $SRV1
120+
$test = Invoke-Command { Get-CimInstance -ClassName win32_computersystem -property domain } -session $SRV1
121121
$test.domain | Should Be "company.pri"
122122
}
123123

124124
It "[SRV1] Should have an IP address of 192.168.3.50" {
125-
$i = Invoke-command -ScriptBlock { Get-NetIPAddress -interfacealias 'Ethernet' -AddressFamily IPv4 } -Session $SRV1
126-
$i.ipv4Address | should be '192.168.3.50'
125+
$i = Invoke-Command -ScriptBlock { Get-NetIPAddress -interfacealias 'Ethernet' -AddressFamily IPv4 } -Session $SRV1
126+
$i.ipv4Address | Should be '192.168.3.50'
127127
}
128128
$dns = Invoke-Command { Get-DnsClientServerAddress -InterfaceAlias ethernet -AddressFamily IPv4 } -session $SRV1
129129
It "[SRV1] Should have a DNS server configuration of 192.168.3.10" {
130130
$dns.ServerAddresses -contains '192.168.3.10' | Should Be "True"
131131
}
132132

133133
It "[SRV1] Should be running Windows Server 2016" {
134-
$test = Invoke-Command { Get-Ciminstance -ClassName win32_operatingsystem -property caption } -session $srv1
134+
$test = Invoke-Command { Get-CimInstance -ClassName win32_operatingsystem -property caption } -session $srv1
135135
$test.caption | Should BeLike '*2016*'
136136
}
137137
} #SRV1
@@ -142,52 +142,51 @@ Describe SRV2 {
142142
$all += $srv2
143143
}
144144
Catch {
145-
Write-Warning "Failed to create PSSession to DOM1. $($_.exception.message)"
145+
Write-Warning "Failed to create PSSession to SRV2. $($_.exception.message)"
146146
#bail out of the test
147147
Return
148148
} It "[SRV2] Should belong to the COMPANY domain" {
149-
$test = Invoke-Command { Get-Ciminstance -ClassName win32_computersystem -property domain } -session $SRV2
149+
$test = Invoke-Command { Get-CimInstance -ClassName win32_computersystem -property domain } -session $SRV2
150150
$test.domain | Should Be "company.pri"
151151
}
152152

153153
It "[SRV2] Should have an IP address of 192.168.3.51" {
154-
$i = Invoke-command -ScriptBlock { Get-NetIPAddress -interfacealias 'Ethernet' -AddressFamily IPv4 } -Session $SRV2
155-
$i.ipv4Address | should be '192.168.3.51'
154+
$i = Invoke-Command -ScriptBlock { Get-NetIPAddress -interfacealias 'Ethernet' -AddressFamily IPv4 } -Session $SRV2
155+
$i.ipv4Address | Should be '192.168.3.51'
156156
}
157157
$dns = Invoke-Command { Get-DnsClientServerAddress -InterfaceAlias ethernet -AddressFamily IPv4 } -session $SRV2
158158
It "[SRV2] Should have a DNS server configuration of 192.168.3.10" {
159159
$dns.ServerAddresses -contains '192.168.3.10' | Should Be "True"
160160
}
161161

162162
It "[SRV2] Should have the Web-Server feature installed" {
163-
$feature = Invoke-command { Get-WindowsFeature -Name web-server } -session $SRV2
163+
$feature = Invoke-Command { Get-WindowsFeature -Name web-server } -session $SRV2
164164
$feature.Installed | Should be $True
165165
}
166166

167167
It "[SRV2] Should have a sample web service file" {
168-
$file = Invoke-Command { Get-item C:\MyWebServices\firstservice.asmx } -session $SRV2
169-
$file.name | should be 'firstservice.asmx'
168+
$file = Invoke-Command { Get-Item C:\MyWebServices\firstservice.asmx } -session $SRV2
169+
$file.name | Should be 'firstservice.asmx'
170170
}
171171
It "[SRV2] Should have a WebApplication called MyWebServices" {
172-
$app = Invoke-command { Get-WebApplication -Name MyWebServices } -session $SRV2
172+
$app = Invoke-Command { Get-WebApplication -Name MyWebServices } -session $SRV2
173173
$app.path | Should be "/MyWebServices"
174-
$app.physicalpath | should be "c:\MyWebServices"
174+
$app.physicalpath | Should be "c:\MyWebServices"
175175
}
176176

177177
It "[SRV2] Should be running Windows Server 2016" {
178-
$test = Invoke-Command { Get-Ciminstance -ClassName win32_operatingsystem -property caption } -session $srv2
178+
$test = Invoke-Command { Get-CimInstance -ClassName win32_operatingsystem -property caption } -session $srv2
179179
$test.caption | Should BeLike '*2016*'
180180
}
181181
} #SRV2
182182

183-
184183
Describe SRV3 {
185184
Try {
186185
$srv3 = New-PSSession -VMName SRV3 -Credential $wgCred -ErrorAction Stop
187186
$all += $srv3
188187
}
189188
Catch {
190-
Write-Warning "Failed to create PSSession to DOM1. $($_.exception.message)"
189+
Write-Warning "Failed to create PSSession to SRV3. $($_.exception.message)"
191190
#bail out of the test
192191
Return
193192
}
@@ -206,10 +205,9 @@ Describe SRV3 {
206205
}
207206

208207
It "[SRV3] Should be running Windows Server 2019" {
209-
$test = Invoke-Command { Get-Ciminstance -ClassName win32_operatingsystem -property caption } -session $srv3
208+
$test = Invoke-Command { Get-CimInstance -ClassName win32_operatingsystem -property caption } -session $srv3
210209
$test.caption | Should BeLike '*2019*'
211210
}
212-
213211
}
214212
#>
215213

@@ -225,18 +223,18 @@ Describe Win10 {
225223
Return
226224
}
227225
It "[WIN10] Should belong to the COMPANY domain" {
228-
$test = Invoke-Command { Get-Ciminstance -ClassName win32_computersystem -property domain } -session $cl
226+
$test = Invoke-Command { Get-CimInstance -ClassName win32_computersystem -property domain } -session $cl
229227
$test.domain | Should Be "company.pri"
230228
}
231229

232230
It "[WIN10] Should be running Windows 10 Enterprise version 18362" {
233-
$test = Invoke-Command { Get-Ciminstance -ClassName win32_operatingsystem -property version, caption } -session $cl
231+
$test = Invoke-Command { Get-CimInstance -ClassName win32_operatingsystem -property version, caption } -session $cl
234232
$test.Version | Should Be '10.0.18362'
235233
$test.caption | Should BeLike "*Enterprise*"
236234
}
237235

238236
It "[Win10] Should have an IP address of 192.168.3.100" {
239-
$i = Invoke-command -ScriptBlock { Get-NetIPAddress -interfacealias 'Ethernet' -AddressFamily IPv4 } -session $cl
237+
$i = Invoke-Command -ScriptBlock { Get-NetIPAddress -interfacealias 'Ethernet' -AddressFamily IPv4 } -session $cl
240238
$i.ipv4Address | Should be '192.168.3.100'
241239
}
242240

@@ -249,7 +247,7 @@ Describe Win10 {
249247
$pkg = Invoke-Command { Get-WindowsCapability -online -name *rsat* } -session $cl
250248

251249
# write-host ($pkg | Select-object Name,Displayname,State | format-list | Out-String) -ForegroundColor cyan
252-
$pkg.State | should match "Installed"
250+
$pkg.State | Should match "Installed"
253251

254252
}
255253
} #client

Configurations/SingleServer/VMConfiguration.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Configuration AutoLab {
77

88
#region DSC Resources
99
Import-DSCresource -ModuleName "PSDesiredStateConfiguration" -ModuleVersion "1.1"
10-
Import-DSCResource -modulename "xPSDesiredStateConfiguration" -ModuleVersion "9.0.0"
10+
Import-DSCResource -modulename "xPSDesiredStateConfiguration" -ModuleVersion "9.1.0"
1111
Import-DSCResource -modulename "xComputerManagement" -ModuleVersion "4.1.0.0"
1212
Import-DSCResource -modulename "xNetworking" -ModuleVersion "5.7.0.0"
1313

0 commit comments

Comments
 (0)