@@ -27,7 +27,7 @@ Describe DOM1 {
27
27
}
28
28
29
29
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
31
31
$test.domain | Should Be " company.pri"
32
32
}
33
33
@@ -42,16 +42,16 @@ Describe DOM1 {
42
42
}
43
43
44
44
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'
47
47
}
48
48
49
49
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
52
52
}
53
53
54
- $OUs = Invoke-command { Get-ADorganizationalUnit - filter * - ErrorAction SilentlyContinue } - session $dc
54
+ $OUs = Invoke-Command { Get-ADOrganizationalUnit - filter * - ErrorAction SilentlyContinue } - session $dc
55
55
$needed = ' IT' , ' Dev' , ' Marketing' , ' Sales' , ' Accounting' , ' JEA_Operators' , ' Servers'
56
56
foreach ($item in $needed ) {
57
57
It " [DOM1] Should have organizational unit $item " {
@@ -68,9 +68,9 @@ Describe DOM1 {
68
68
69
69
}
70
70
71
- $users = Invoke-Command { Get-AdUser - filter * - ErrorAction SilentlyContinue } - session $dc
71
+ $users = Invoke-Command { Get-ADUser - filter * - ErrorAction SilentlyContinue } - session $dc
72
72
It " [DOM1] Should have at least 15 user accounts" {
73
- $users.count | should BeGreaterThan 15
73
+ $users.count | Should BeGreaterThan 15
74
74
}
75
75
76
76
$admins = Invoke-Command { Get-ADGroupMember " Domain Admins" - ErrorAction SilentlyContinue } - session $dc
@@ -95,14 +95,14 @@ Describe DOM1 {
95
95
$computer.name -contains " SRV2" | Should Be " True"
96
96
}
97
97
98
- $rec = Invoke-command { Resolve-DNSName Srv3.company.pri } - session $DC
98
+ $rec = Invoke-Command { Resolve-DnsName Srv3.company.pri } - session $DC
99
99
It " [DOM1] Should have a DNS record for SRV3.COMPANY.PRI" {
100
100
$rec.name | Should be ' srv3.company.pri'
101
101
$rec.ipaddress | Should be ' 192.168.3.60'
102
102
}
103
103
104
104
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
106
106
$test.caption | Should BeLike ' *2016*'
107
107
}
108
108
} # DOM1
@@ -113,25 +113,25 @@ Describe SRV1 {
113
113
$all += $srv1
114
114
}
115
115
Catch {
116
- Write-Warning " Failed to create PSSession to DOM1 . $ ( $_.exception.message ) "
116
+ Write-Warning " Failed to create PSSession to SRV1 . $ ( $_.exception.message ) "
117
117
# bail out of the test
118
118
Return
119
119
} 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
121
121
$test.domain | Should Be " company.pri"
122
122
}
123
123
124
124
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'
127
127
}
128
128
$dns = Invoke-Command { Get-DnsClientServerAddress - InterfaceAlias ethernet - AddressFamily IPv4 } - session $SRV1
129
129
It " [SRV1] Should have a DNS server configuration of 192.168.3.10" {
130
130
$dns.ServerAddresses -contains ' 192.168.3.10' | Should Be " True"
131
131
}
132
132
133
133
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
135
135
$test.caption | Should BeLike ' *2016*'
136
136
}
137
137
} # SRV1
@@ -142,52 +142,51 @@ Describe SRV2 {
142
142
$all += $srv2
143
143
}
144
144
Catch {
145
- Write-Warning " Failed to create PSSession to DOM1 . $ ( $_.exception.message ) "
145
+ Write-Warning " Failed to create PSSession to SRV2 . $ ( $_.exception.message ) "
146
146
# bail out of the test
147
147
Return
148
148
} 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
150
150
$test.domain | Should Be " company.pri"
151
151
}
152
152
153
153
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'
156
156
}
157
157
$dns = Invoke-Command { Get-DnsClientServerAddress - InterfaceAlias ethernet - AddressFamily IPv4 } - session $SRV2
158
158
It " [SRV2] Should have a DNS server configuration of 192.168.3.10" {
159
159
$dns.ServerAddresses -contains ' 192.168.3.10' | Should Be " True"
160
160
}
161
161
162
162
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
164
164
$feature.Installed | Should be $True
165
165
}
166
166
167
167
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'
170
170
}
171
171
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
173
173
$app.path | Should be " /MyWebServices"
174
- $app.physicalpath | should be " c:\MyWebServices"
174
+ $app.physicalpath | Should be " c:\MyWebServices"
175
175
}
176
176
177
177
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
179
179
$test.caption | Should BeLike ' *2016*'
180
180
}
181
181
} # SRV2
182
182
183
-
184
183
Describe SRV3 {
185
184
Try {
186
185
$srv3 = New-PSSession - VMName SRV3 - Credential $wgCred - ErrorAction Stop
187
186
$all += $srv3
188
187
}
189
188
Catch {
190
- Write-Warning " Failed to create PSSession to DOM1 . $ ( $_.exception.message ) "
189
+ Write-Warning " Failed to create PSSession to SRV3 . $ ( $_.exception.message ) "
191
190
# bail out of the test
192
191
Return
193
192
}
@@ -206,10 +205,9 @@ Describe SRV3 {
206
205
}
207
206
208
207
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
210
209
$test.caption | Should BeLike ' *2019*'
211
210
}
212
-
213
211
}
214
212
# >
215
213
@@ -225,18 +223,18 @@ Describe Win10 {
225
223
Return
226
224
}
227
225
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
229
227
$test.domain | Should Be " company.pri"
230
228
}
231
229
232
230
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
234
232
$test.Version | Should Be ' 10.0.18362'
235
233
$test.caption | Should BeLike " *Enterprise*"
236
234
}
237
235
238
236
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
240
238
$i.ipv4Address | Should be ' 192.168.3.100'
241
239
}
242
240
@@ -249,7 +247,7 @@ Describe Win10 {
249
247
$pkg = Invoke-Command { Get-WindowsCapability - online - name * rsat* } - session $cl
250
248
251
249
# 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"
253
251
254
252
}
255
253
} # client
0 commit comments