This repository was archived by the owner on Jun 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 133
Expand file tree
/
Copy pathGet-PSResourceValidations.ps1
More file actions
104 lines (70 loc) · 4 KB
/
Get-PSResourceValidations.ps1
File metadata and controls
104 lines (70 loc) · 4 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#######################
### Get-PSResource ###
#######################
### Getting Installed Modules ###
# Should get the module 'TestModule'
Get-PSResource 'TestModule'
# Should get the module 'TestModule'
Get-PSResource -name 'TestModule'
# Should get the module 'TestModule'
Get-PSResource 'TestModule' -Type 'Module'
# Should get the module 'TestModule'
Get-PSResource 'TestModule' -Type 'Module', 'Script', 'Library'
# Should get the modules 'TestModule1', 'TestModule2', 'TestModule3'
Get-PSResource 'TestModule1', 'TestModule2', 'TestModule3'
# Should get the latest, non-prerelease version of the module 'TestModule' that is at least 1.5.0
Get-PSResource 'TestModule' -MinimumVersion '1.5.0'
# Should get the latest, non-prerelease version of the module 'TestModule' that is at most 1.5.0
Get-PSResource 'TestModule' -MaximumVersion '1.5.0'
# Should get the latest, non-prerelease version of the module 'TestModule' that is at least version 1.0.0 and at most 2.0.0
Get-PSResource 'TestModule' -MinimumVersion '1.0.0' -MaximumVersion '2.0.0'
# Should get version 1.5.0 (non-prerelease) of the module 'TestModule'
Get-PSResource 'TestModule' -RequiredVersion '1.5.0'
# Should find all non-prerelease versions of the module 'TestModule'
Get-PSResource 'TestModule' -AllVersions
# Should get the latest verison of 'TestModule', including prerelease versions
Get-PSResource 'TestModule' -Prerelease
### Getting Installed Scripts ###
# Should get the script 'TestScript'
Get-PSResource 'TestScript'
# Should get the script 'TestScript'
Get-PSResource -name 'TestScript'
# Should get the module 'TestScript'
Get-PSResource 'TestScript' -Type 'Script'
# Should get the module 'TestScript'
Get-PSResource 'TestScript' -Type 'Module', 'Script', 'Library'
# Should get the scripts 'TestScript1', 'TestScript2', 'TestScript3'
Get-PSResource 'TestScript1', 'TestScript2', 'TestScript3'
# Should get the latest, non-prerelease version of the script 'TestScript' that is at least 1.5.0
Get-PSResource 'TestScript' -MinimumVersion '1.5.0'
# Should get the latest, non-prerelease version of the script 'TestScript' that is at most 1.5.0
Get-PSResource 'TestScript' -MaximumVersion '1.5.0'
# Should get the latest, non-prerelease version of the script 'TestScript' that is at least version 1.0.0 and at most 2.0.0
Get-PSResource 'TestScript' -MinimumVersion '1.0.0' -MaximumVersion '2.0.0'
# Should get version 1.5.0 (non-prerelease) of the script 'TestScript'
Get-PSResource 'TestScript' -RequiredVersion '1.5.0'
# Should find all non-prerelease versions of the module 'TestModule'
Get-PSResource 'TestModule' -AllVersions
# Should get the latest verison of 'TestScript', including prerelease versions
Get-PSResource 'TestScript' -Prerelease
### Getting Installed Nupkgs ###
# Should get the nupkg 'TestNupkg'
Get-PSResource 'TestNupkg'
# Should get the nupkg 'TestNupkg'
Get-PSResource 'TestNupkg' -Type 'Library'
# Should get the nupkg 'TestNupkg'
Get-PSResource 'TestNupkg' -Type 'Module', 'Script', 'Library'
# Should get the nupkgs 'TestNupkg1', 'TestNupkg2', 'TestNupkg3'
Get-PSResource 'TestNupkg1', 'TestNupkg2', 'TestNupkg3'
# Should get the latest, non-prerelease version of the nupkg 'TestNupkg' that is at least 1.5.0
Get-PSResource 'TestNupkg' -MinimumVersion '1.5.0'
# Should get the latest, non-prerelease version of the nupkg 'TestNupkg' that is at most 1.5.0
Get-PSResource 'TestNupkg' -MaximumVersion '1.5.0'
# Should get the latest, non-prerelease version of the nupkg 'TestNupkg' that is at least version 1.0.0 and at most 2.0.0
Get-PSResource 'TestNupkg' -MinimumVersion '1.0.0' -MaximumVersion '2.0.0'
# Should get version 1.5.0 (non-prerelease) of the nupkg 'TestNupkg'
Get-PSResource 'TestNupkg' -RequiredVersion '1.5.0'
# Should find all non-prerelease versions of the module 'TestModule'
Get-PSResource 'TestModule' -AllVersions
# Should get the latest verison of 'TestNupkg', including prerelease versions
Get-PSResource 'TestNupkg' -Prerelease