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 pathSave-PSResourceValidations.ps1
More file actions
152 lines (102 loc) · 6.14 KB
/
Save-PSResourceValidations.ps1
File metadata and controls
152 lines (102 loc) · 6.14 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#######################
### Save-PSResource ###
#######################
### Saving Modules ###
# Should save the module 'TestModule'
Save-PSResource 'TestModule'
# Should save the module 'TestModule'
Save-PSResource -name 'TestModule'
# Should save the module 'TestModule'
Save-PSResource 'TestModule' -Type 'Module'
# Should save the module 'TestModule'
Save-PSResource 'TestModule' -Type 'Module', 'Script', 'Library'
# Should save the modules 'TestModule1', 'TestModule2', 'TestModule3'
Save-PSResource 'TestModule1', 'TestModule2', 'TestModule3'
# Should save the latest, non-prerelease version of the module 'TestModule' that is at least 1.5.0
Save-PSResource 'TestModule' -MinimumVersion '1.5.0'
# Should save the latest, non-prerelease version of the module 'TestModule' that is at most 1.5.0
Save-PSResource 'TestModule' -MaximumVersion '1.5.0'
# Should save the latest, non-prerelease version of the module 'TestModule' that is at least version 1.0.0 and at most 2.0.0
Save-PSResource 'TestModule' -MinimumVersion '1.0.0' -MaximumVersion '2.0.0'
# Should save version 1.5.0 (non-prerelease) of the module 'TestModule'
Save-PSResource 'TestModule' -RequiredVersion '1.5.0'
# Should save the latest verison of 'TestModule', including prerelease versions
Save-PSResource 'TestModule' -Prerelease
# Should save 'TestModule' from one of the specified repositories (based on repo priority)
Save-PSResource 'TestModule' -Repository 'Repository1', 'Repository2'
# Should save the module 'TestModule' to the specified directory
Save-PSResource 'TestModule' -Path '.\*\somepath'
# Should save the module 'TestModule' to the specified directory
Save-PSResource 'TestModule' -LiteralPath '.'
# Should save the module 'TestModule' without prompting user for confirmation
Save-PSResource 'TestModule' -Force
#Should save the module 'TestModule' and automatically accept license agreement
Save-PSResource 'TestModule' -AcceptLicense
#Should save the module 'TestModule' from the input object
Find-PSResource 'TestModule' | Save-PSresource
### Saving Scripts ###
# Should save the script 'TestScript'
Save-PSResource 'TestScript'
# Should save the script 'TestScript'
Save-PSResource -name 'TestScript'
# Should save the module 'TestScript'
Save-PSResource 'TestScript' -Type 'Script'
# Should save the module 'TestScript'
Save-PSResource 'TestScript' -Type 'Module', 'Script', 'Library'
# Should save the scripts 'TestScript1', 'TestScript2', 'TestScript3'
Save-PSResource 'TestScript1', 'TestScript2', 'TestScript3'
# Should save the latest, non-prerelease version of the script 'TestScript' that is at least 1.5.0
Save-PSResource 'TestScript' -MinimumVersion '1.5.0'
# Should save the latest, non-prerelease version of the script 'TestScript' that is at most 1.5.0
Save-PSResource 'TestScript' -MaximumVersion '1.5.0'
# Should save the latest, non-prerelease version of the script 'TestScript' that is at least version 1.0.0 and at most 2.0.0
Save-PSResource 'TestScript' -MinimumVersion '1.0.0' -MaximumVersion '2.0.0'
# Should save version 1.5.0 (non-prerelease) of the script 'TestScript'
Save-PSResource 'TestScript' -RequiredVersion '1.5.0'
# Should save the latest verison of 'TestScript', including prerelease versions
Save-PSResource 'TestScript' -Prerelease
# Should save 'TestScript' from one of the specified repositories (based on repo priority)
Save-PSResource 'TestScript' -Repository 'Repository1', 'Repository2'
# Should save the script 'TestScript' to the specified directory
Save-PSResource 'TestModule' -Path '.\*\somepath'
# Should save the script 'TestScript' to the specified directory
Save-PSResource 'TestModule' -LiteralPath '.'
# Should save the script 'TestScript' without prompting message regarding untrusted sources
Save-PSResource 'TestScript' -Force
#Should save the script 'TestScript' and automatically accept license agreement
Save-PSResource 'TestScript' -AcceptLicense
#Should save the script 'TestScript' from the input object
Find-PSResource 'TestScript' | Save-PSresource
### Saving Nupkgs ###
# Should save the nupkg 'TestNupkg'
Save-PSResource 'TestNupkg'
# Should save the nupkg 'TestNupkg'
Save-PSResource 'TestNupkg' -Type 'Library'
# Should save the nupkg 'TestNupkg'
Save-PSResource 'TestNupkg' -Type 'Module', 'Script', 'Library'
# Should save the nupkgs 'TestNupkg1', 'TestNupkg2', 'TestNupkg3'
Save-PSResource 'TestNupkg1', 'TestNupkg2', 'TestNupkg3'
# Should save the latest, non-prerelease version of the nupkg 'TestNupkg' that is at least 1.5.0
Save-PSResource 'TestNupkg' -MinimumVersion '1.5.0'
# Should save the latest, non-prerelease version of the nupkg 'TestNupkg' that is at most 1.5.0
Save-PSResource 'TestNupkg' -MaximumVersion '1.5.0'
# Should save the latest, non-prerelease version of the nupkg 'TestNupkg' that is at least version 1.0.0 and at most 2.0.0
Save-PSResource 'TestNupkg' -MinimumVersion '1.0.0' -MaximumVersion '2.0.0'
# Should save version 1.5.0 (non-prerelease) of the nupkg 'TestNupkg'
Save-PSResource 'TestNupkg' -RequiredVersion '1.5.0'
# Should save the latest verison of 'TestNupkg', including prerelease versions
Save-PSResource 'TestNupkg' -Prerelease
# Should save the nupkg 'TestNupkg' from one of the specified repositories (based on repo priority)
Save-PSResource 'TestNupkg' -Repository 'Repository1', 'Repository2'
# Should save the script 'TestScript' to the specified directory
Save-PSResource 'TestModule' -Path '.\*\somepath'
# Should save the script 'TestScript' to the specified directory
Save-PSResource 'TestModule' -LiteralPath '.'
# Should save the nupkg 'TestNupkg' without prompting user for confirmation
Save-PSResource 'TestNupkg' -Force
#Should save the nupkg 'TestNupkg' and automatically accept license agreement
Save-PSResource 'TestNupkg' -AcceptLicense
#Should save the nupkg 'TestNupkg' as a nupkg (if it was originally nupkg) instead of expanding it into a folder
Save-PSResource 'TestNupkg' -AsNupkg
#Should save the nupkg 'TestNupkg' and retain the runtimes directory hierarchy within the nupkg to the root of the destination
Save-PSResource 'TestNupkg' -IncludeAllRuntimes