-
Notifications
You must be signed in to change notification settings - Fork 32
/
poshspecdemo.ps1
49 lines (39 loc) · 1.62 KB
/
poshspecdemo.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#Requires -Module Poshspec
Describe 'Services' {
Service w32time Status { Should -Be Running }
Service bits Status { Should -Be Stopped }
}
Describe 'Files' {
File C:\inetpub\wwwroot\iisstart.htm { Should -Exist }
File C:\inetpub\wwwroot\iisstart.htm { Should -FileContentMatch 'text-align:center' }
}
Describe 'Registry' {
Registry HKLM:\SOFTWARE\Microsoft\Rpc\ClientProtocols { Should -Exist }
Registry HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\ "SyncDomainWithMembership" { Should -Be 1 }
Registry 'HKLM:\SOFTWARE\Callahan Auto\' { Should -Not -Exist }
}
Describe 'Http' {
TcpPort localhost 80 PingSucceeded { Should -Be $true }
TcpPort localhost 80 TcpTestSucceeded { Should -Be $true }
Http http://localhost StatusCode { Should -Be 200 }
Http http://localhost RawContent { Should -Match 'X-Powered-By: ASP.NET' }
Http http://localhost RawContent { Should -Not -Match 'X-Powered-By: Cobal' }
}
Describe 'Hotfix' {
Hotfix KB3116900 { Should -Not -BeNullOrEmpty }
Hotfix KB1112233 { Should -BeNullOrEmpty }
}
Describe 'CimObject' {
CimObject Win32_OperatingSystem SystemDirectory { Should -Be C:\WINDOWS\system32 }
CimObject root/StandardCimv2/MSFT_NetOffloadGlobalSetting ReceiveSideScaling { Should -Be Enabled }
}
Describe 'Firewall' {
Firewall putty.exe Enabled { Should -Be "$True" }
Firewall putty.exe Action { Should -Be 'Allow' }
Firewall putty.exe Profile { Should -Be 'Private' }
}
Describe 'Volume' {
Volume C DriveType { Should -Be 'fixed' }
Volume C FileSystem { Should -Be 'NTFS' }
Volume 'ShouldNotExist' { Should -BeNullOrEmpty }
}