@@ -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-
184183Describe 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
0 commit comments