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

Commit 19f32d6

Browse files
committed
rename module terms and files to OperationValidation and update readme file
1 parent 3430e50 commit 19f32d6

File tree

8 files changed

+658
-0
lines changed

8 files changed

+658
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Describe "Windows Search finds the proper application" {
2+
It "Finds notepad" {
3+
$con = new-object -com ADODB.Connection
4+
$rs = new-object -com ADODB.RecordSet
5+
$con.Open("Provider=Search.CollatorDSO;Extended properties='Application=Windows';")
6+
$rs.Open("Select System.ItemPathDisplay FROM SYSTEMINDEX Where System.FileName = 'notepad.exe'",$con)
7+
$rs.MoveFirst()
8+
$notepads = @()
9+
While(! $rs.EOF ){
10+
$notepads += $rs.Fields['System.ItemPathDisplay'].Value
11+
$rs.MoveNext()
12+
}
13+
$rs.Close()
14+
$con.Close()
15+
$notepadPath = "C:\Windows\System32\notepad.exe"
16+
$notepads -eq $notepadpath | Should be $notepadpath
17+
18+
}
19+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Describe "E2E validation of PSGallery" {
2+
BeforeAll {
3+
$Repository = "InternalPSGallery"
4+
$ModuleName = "FormatTools"
5+
$Version = "0.5.0"
6+
import-module PowerShellGet -Force
7+
if ( Get-Module -list ${ModuleName} )
8+
{
9+
# the module is already installed
10+
$PSDefaultParameterValues["It:skip"] = $true
11+
}
12+
}
13+
14+
It "should return the same number of modules via cmdlets and website" {
15+
$GalleryUrl = "http://psget/psgallery"
16+
# timing window here - between these two operations, modules list may change
17+
$wc = new-object System.Net.WebClient
18+
$modules = Find-Module -Repository InternalPSGallery -ea SilentlyContinue
19+
$page = $wc.downloadstring("${GalleryUrl}/packages").replace("`n","")
20+
$expectedCount = $page -replace ".*There are (\d+) modules.*",'$1'
21+
$modules.Count | Should be $expectedCount
22+
}
23+
It -skip:$false "Should be possible to find a known module" {
24+
$myModule = find-module -repository ${Repository} -Name ${ModuleName} -RequiredVersion ${Version}
25+
$myModule.Name | Should be ${ModuleName}
26+
$myModule.Version | Should be $Version
27+
}
28+
It "Should be possible to install and import a known module" {
29+
install-module -Force -Name ${ModuleName} -RequiredVersion ${Version} -Repository ${Repository} -Scope CurrentUser
30+
$m = Import-Module ${ModuleName} -PassThru
31+
$m.ModuleBase.IndexOf($HOME) | Should be 0
32+
}
33+
AfterAll {
34+
if ( $PSDefaultParameterValues["It:skip"] -ne $true)
35+
{
36+
Uninstall-Module -force -RequiredVersion ${version} -Name ${ModuleName} -ea SilentlyContinue
37+
}
38+
}
39+
}
40+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Describe "Simple Validation of PSGallery" {
2+
It "The PowerShell Gallery should be responsive" {
3+
$request = [System.Net.WebRequest]::Create("http://psget/psgallery")
4+
$response = $Request.GetResponse()
5+
$response.StatusCode | Should be OK
6+
}
7+
}
8+
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
<Configuration>
2+
<ViewDefinitions>
3+
<View>
4+
<Name>OperationValidationResultTable</Name>
5+
<ViewSelectedBy>
6+
<TypeName>OperationValidationResult</TypeName>
7+
</ViewSelectedBy>
8+
<GroupBy>
9+
<PropertyName>Module</PropertyName>
10+
<Label>Module</Label>
11+
</GroupBy>
12+
<TableControl>
13+
<TableHeaders>
14+
<TableColumnHeader><Label>Result</Label></TableColumnHeader>
15+
<TableColumnHeader><Label>Name</Label></TableColumnHeader>
16+
</TableHeaders>
17+
<TableRowEntries>
18+
<TableRowEntry>
19+
<TableColumnItems>
20+
<TableColumnItem><PropertyName>Result</PropertyName></TableColumnItem>
21+
<TableColumnItem><PropertyName>Name</PropertyName></TableColumnItem>
22+
</TableColumnItems>
23+
</TableRowEntry>
24+
</TableRowEntries>
25+
</TableControl>
26+
</View>
27+
28+
<View>
29+
<Name>OperationValidation</Name>
30+
<ViewSelectedBy>
31+
<TypeName>OperationValidationInfo</TypeName>
32+
</ViewSelectedBy>
33+
<CustomControl>
34+
<CustomEntries>
35+
<CustomEntry>
36+
<CustomItem>
37+
38+
<Text>Module: </Text>
39+
<Frame>
40+
<LeftIndent>4</LeftIndent>
41+
<CustomItem>
42+
<ExpressionBinding>
43+
<PropertyName>ModuleName</PropertyName>
44+
</ExpressionBinding>
45+
<NewLine/>
46+
</CustomItem>
47+
</Frame>
48+
49+
<Text>Type: </Text>
50+
<Frame>
51+
<LeftIndent>4</LeftIndent>
52+
<CustomItem>
53+
<ExpressionBinding>
54+
<PropertyName>Type</PropertyName>
55+
</ExpressionBinding>
56+
<NewLine/>
57+
</CustomItem>
58+
</Frame>
59+
60+
<Text>File: </Text>
61+
<Frame>
62+
<LeftIndent>4</LeftIndent>
63+
<CustomItem>
64+
<ExpressionBinding>
65+
<PropertyName>File</PropertyName>
66+
</ExpressionBinding>
67+
<NewLine/>
68+
</CustomItem>
69+
</Frame>
70+
71+
<Text>FilePath: </Text>
72+
<Frame>
73+
<LeftIndent>4</LeftIndent>
74+
<CustomItem>
75+
<ExpressionBinding>
76+
<PropertyName>FilePath</PropertyName>
77+
</ExpressionBinding>
78+
<NewLine/>
79+
</CustomItem>
80+
</Frame>
81+
82+
<Text>Name: </Text>
83+
<Frame>
84+
<LeftIndent>4</LeftIndent>
85+
<CustomItem>
86+
<NewLine/>
87+
<Frame>
88+
<LeftIndent>4</LeftIndent>
89+
<CustomItem>
90+
<ExpressionBinding>
91+
<PropertyName>Name</PropertyName>
92+
<EnumerateCollection/>
93+
<CustomControl>
94+
<CustomEntries>
95+
<CustomEntry>
96+
<CustomItem>
97+
<ExpressionBinding>
98+
<ScriptBlock>$_</ScriptBlock>
99+
</ExpressionBinding>
100+
<NewLine/>
101+
</CustomItem>
102+
</CustomEntry>
103+
</CustomEntries>
104+
</CustomControl>
105+
</ExpressionBinding>
106+
</CustomItem>
107+
</Frame>
108+
<NewLine/>
109+
</CustomItem>
110+
</Frame>
111+
</CustomItem>
112+
</CustomEntry>
113+
</CustomEntries>
114+
</CustomControl>
115+
</View>
116+
</ViewDefinitions>
117+
</Configuration>
Binary file not shown.

0 commit comments

Comments
 (0)