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 pathRepositoryValidations.ps1
More file actions
203 lines (154 loc) · 8.01 KB
/
RepositoryValidations.ps1
File metadata and controls
203 lines (154 loc) · 8.01 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
#####################################
### Register-PSResourceRepository ###
#####################################
# Should register the PowerShell Gallery
Register-PSRepository -PSGallery
<<<<<<< HEAD
# Should register the repository 'TestRepo'
Register-PSResourceRepository 'TestRepo' 'www.testrepo.com'
# Should register the repository 'TestRepo'
Register-PSResourceRepository -name 'TestRepo' -url 'www.testrepo.com'
# Should register the repository 'TestRepo' as trusted, priority should be set to 0
Register-PSResourceRepository -name 'TestRepo' -url 'www.testrepo.com' -Trusted
# Should register the repository 'TestRepo' with a priority of 2
Register-PSResourceRepository -name 'TestRepo' -url 'www.testrepo.com' -Priority 2
### Repositories
# Should register the repositories 'TestRepo1', 'TestRepo2', 'PSGallery'
Register-PSResourceRepository -Repositories @(
@{ Name = 'TestRepo1'; URL = 'https://testrepo1.com'; Trusted = $true; Credential = $cred }
@{ Name = 'TestRepo2'; URL = '\\server\share\myrepository'; Trusted = $true }
@{ Default = $true; Trusted = $true }
)
# Should return the repositories 'TestRepo1', 'TestRepo2', 'PSGallery'
$repos = @(
@{ Name = 'TestRepo1'; URL = 'https://testrepo1.com'; Trusted = $true; }
@{ Name = 'TestRepo2'; URL = '\\server\share\myrepository'; Trusted = $true }
=======
# Should register the repository "TestRepo"
Register-PSResourceRepository "TestRepo" "www.testrepo.com"
# Should register the repository "TestRepo"
Register-PSResourceRepository -name "TestRepo" -url "www.testrepo.com"
# Should register the repository "TestRepo" as trusted, priority should be set to 0
Register-PSResourceRepository -name "TestRepo" -url "www.testrepo.com" -Trusted
# Should register the repository "TestRepo" with a priority of 2
Register-PSResourceRepository -name "TestRepo" -url "www.testrepo.com" -Priority 2
### Repositories
# Should register the repositories "TestRepo1", "TestRepo2", "PSGallery"
Register-PSResourceRepository -Repositories @(
@{ Name = "TestRepo1"; URL = "https://testrepo1.com"; Trusted = $true; Credential = $cred }
@{ Name = "TestRepo2"; URL = "\\server\share\myrepository"; Trusted = $true }
@{ Default = $true; Trusted = $true }
)
# Should return the repositories "TestRepo1", "TestRepo2", "PSGallery"
$repos = @(
@{ Name = "TestRepo1"; URL = "https://testrepo1.com"; Trusted = $true; }
@{ Name = "TestRepo2"; URL = "\\server\share\myrepository"; Trusted = $true }
>>>>>>> 419fe737e7f5e0c8d31477cb656faa0ded253c37
@{ Default = $true; Trusted = $true }
)
$repos | Register-PSResourceRepository
################################
### Get-PSResourceRepository ###
################################
# Should return all repositories
Get-PSResourceRepository
<<<<<<< HEAD
# Should return the repository 'TestRepo'
Get-PSResourceRepository 'TestRepo'
# Should return the repository 'TestRepo'
Get-PSResourceRepository -name 'TestRepo'
# Should return the repositories 'TestRepo1', 'TestRepo2', 'TestRepo3'
Get-PSResourceRepository 'TestRepo1', 'TestRepo2', 'TestRepo3'
# Should return the repositories 'TestRepo1', 'TestRepo2', 'TestRepo3'
Get-PSResourceRepository -name 'TestRepo1', 'TestRepo2', 'TestRepo3'
# Should return the repository 'TestRepo'
'TestRepo1' | Get-PSResourceRepository
# Should return the repositories 'TestRepo1', 'TestRepo2', 'TestRepo3'
'TestRepo1', 'TestRepo2', 'TestRepo3' | Get-PSResourceRepository
=======
# Should return the repository "TestRepo"
Get-PSResourceRepository "TestRepo"
# Should return the repository "TestRepo"
Get-PSResourceRepository -name "TestRepo"
# Should return the repositories "TestRepo1", "TestRepo2", "TestRepo3"
Get-PSResourceRepository "TestRepo1", "TestRepo2", "TestRepo3"
# Should return the repositories "TestRepo1", "TestRepo2", "TestRepo3"
Get-PSResourceRepository -name "TestRepo1", "TestRepo2", "TestRepo3"
# Should return the repository "TestRepo"
"TestRepo1" | Get-PSResourceRepository
# Should return the repositories "TestRepo1", "TestRepo2", "TestRepo3"
"TestRepo1", "TestRepo2", "TestRepo3" | Get-PSResourceRepository
>>>>>>> 419fe737e7f5e0c8d31477cb656faa0ded253c37
################################
### Set-PSResourceRepository ###
################################
<<<<<<< HEAD
# Should set the repository 'TestRepo' to the url 'www.testrepo.com'
Set-PSResourceRepository 'TestRepo' 'www.testrepo.com'
# Should set the repository 'TestRepo' to the url 'www.testrepo.com'
Set-PSResourceRepository -name 'TestRepo' -url 'www.testrepo.com'
# Should set the repository 'TestRepo' to trusted, with a priority of 0
Set-PSResourceRepository 'TestRepo' -Trusted
# Should set the repository 'TestRepo' with a priority of 2
Set-PSResourceRepository 'TestRepo' 'www.testrepo.com' -Priority 2
# Should set the repository 'TestRepo'
'TestRepo1' | Set-PSResourceRepository -url 'www.testrepo.com'
### Repositories
# Should set the repositories 'TestRepo1', 'TestRepo2', 'PSGallery' to trusted, with a priority of 0
Set-PSResourceRepository -Repositories @(
@{ Name = 'TestRepo1'; URL = 'https://testrepo1.com'; Trusted = $true; }
@{ Name = 'TestRepo2'; URL = '\\server\share\myrepository'; Trusted = $true }
@{ Default = $true; Trusted = $true }
)
# Should return the repositories 'TestRepo1', 'TestRepo2', 'PSGallery'
$repos = @(
@{ Name = 'TestRepo1'; URL = 'https://testrepo1.com'; Trusted = $true; }
@{ Name = 'TestRepo2'; URL = '\\server\share\myrepository'; Trusted = $true }
=======
# Should set the repository "TestRepo" to the url "www.testrepo.com"
Set-PSResourceRepository "TestRepo" "www.testrepo.com"
# Should set the repository "TestRepo" to the url "www.testrepo.com"
Set-PSResourceRepository -name "TestRepo" -url "www.testrepo.com"
# Should set the repository "TestRepo" to trusted, with a priority of 0
Set-PSResourceRepository "TestRepo" -Trusted
# Should set the repository "TestRepo" with a priority of 2
Set-PSResourceRepository "TestRepo" "www.testrepo.com" -Priority 2
# Should set the repository "TestRepo"
"TestRepo1" | Set-PSResourceRepository -url "www.testrepo.com"
### Repositories
# Should set the repositories "TestRepo1", "TestRepo2", "PSGallery" to trusted, with a priority of 0
Set-PSResourceRepository -Repositories @(
@{ Name = "TestRepo1"; URL = "https://testrepo1.com"; Trusted = $true; }
@{ Name = "TestRepo2"; URL = "\\server\share\myrepository"; Trusted = $true }
@{ Default = $true; Trusted = $true }
)
# Should return the repositories "TestRepo1", "TestRepo2", "PSGallery"
$repos = @(
@{ Name = "TestRepo1"; URL = "https://testrepo1.com"; Trusted = $true; }
@{ Name = "TestRepo2"; URL = "\\server\share\myrepository"; Trusted = $true }
>>>>>>> 419fe737e7f5e0c8d31477cb656faa0ded253c37
@{ Default = $true; Trusted = $true }
)
$repos | Set-PSResourceRepository
#######################################
### Unregister-PSResourceRepository ###
#######################################
<<<<<<< HEAD
# Should unregister the repository 'TestRepo'
Unregister-PSResourceRepository -name 'TestRepo'
# Should unregister the repositories 'TestRepo1', 'TestRepo2', 'TestRepo3'
Unregister-PSResourceRepository -name 'TestRepo1', 'TestRepo2', 'TestRepo3'
# Should unregister the repository 'TestRepo'
'TestRepo1' | Unregister-PSResourceRepository
# Should unregister the repositories 'TestRepo1', 'TestRepo2', 'TestRepo3'
'TestRepo1', 'TestRepo2', 'TestRepo3' | Unregister-PSResourceRepository
=======
# Should unregister the repository "TestRepo"
Unregister-PSResourceRepository -name "TestRepo"
# Should unregister the repositories "TestRepo1", "TestRepo2", "TestRepo3"
Unregister-PSResourceRepository -name "TestRepo1", "TestRepo2", "TestRepo3"
# Should unregister the repository "TestRepo"
"TestRepo1" | Unregister-PSResourceRepository
# Should unregister the repositories "TestRepo1", "TestRepo2", "TestRepo3"
"TestRepo1", "TestRepo2", "TestRepo3" | Unregister-PSResourceRepository
>>>>>>> 419fe737e7f5e0c8d31477cb656faa0ded253c37