Skip to content

Commit a1cb15c

Browse files
authored
Update help files for {Update, Find}-PSResource and {Register, Set, Get, Unregister}-PSResourceRepository (#434)
update help docs
1 parent 8f4f312 commit a1cb15c

6 files changed

+43
-43
lines changed

help/Find-PSResource.md

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
---
22
external help file: PowerShellGet.dll-Help.xml
33
Module Name: PowerShellGet
4-
online version: <add>
4+
online version:
55
schema: 2.0.0
66
---
77

88
# Find-PSResource
99

1010
## SYNOPSIS
11-
Searches for packages from a repository (local or remote), based on Name or other package properties.
12-
11+
Searches for packages from a repository (local or remote), based on `-Name` and other package properties.
1312

1413
## SYNTAX
1514

1615
### ResourceNameParameterSet (Default)
1716
``` PowerShell
18-
[[-Name] <string[]>] [-Type <Microsoft.PowerShell.PowerShellGet.UtilClasses.ResourceType[]>] [-Version <string>] [-Prerelease] [-Tag <string[]>]
19-
[-Repository <string[]>] [-Credential <pscredential>] [-IncludeDependencies] [-WhatIf] [-Confirm] [<CommonParameters>]
17+
[[-Name] <string[]>] [-Type <Microsoft.PowerShell.PowerShellGet.UtilClasses.ResourceType[]>] [-Version <string>] [-Prerelease] [-Tag <string[]>] [-Repository <string[]>] [-Credential <pscredential>] [-IncludeDependencies] [-WhatIf] [-Confirm] [<CommonParameters>]
2018
```
2119

2220
### CommandNameParameterSet
@@ -44,7 +42,7 @@ Searches for packages from a repository (local or remote), based on Name or othe
4442
```
4543

4644
## DESCRIPTION
47-
The `Find-PSResource` cmdlet searches for a package from a repository (local or remote) based on Name or other package properties.
45+
The `Find-PSResource` cmdlet searches for a package from a repository (local or remote) based on `-Name` or other package properties.
4846

4947
## EXAMPLES
5048
These examples assume that the PSGallery repository is registered and contains the packages we are searching for.
@@ -162,7 +160,7 @@ Accept wildcard characters: False
162160
163161
### -Repository
164162
Specifies one or more repository names to search.
165-
If not specified, search will include all currently registered repositories, in order of highest priority, til first repository package is found in.
163+
If not specified, search will include all currently registered repositories, in order of highest priority, until a repository is found that contains the package.
166164
167165
```yaml
168166
Type: System.String[]
@@ -210,6 +208,7 @@ Accept wildcard characters: False
210208
211209
### -Version
212210
Specifies the version of the resource to be returned.
211+
Expected version/version range format is documented here: https://docs.microsoft.com/en-us/nuget/concepts/package-versioning#version-ranges
213212
214213
```yaml
215214
Type: System.String
@@ -261,14 +260,6 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
261260
262261
### System.String[]
263262
264-
### System.String
265-
266-
### System.Management.Automation.PSCredential
267-
268-
### System.Management.Automation.SwitchParameter
269-
270-
### Microsoft.PowerShell.PowerShellGet.UtilClasses.ResourceType[]
271-
272263
## OUTPUTS
273264
274265
### Microsoft.PowerShell.PowerShellGet.UtilClasses.PSResourceInfo

help/Get-PSResourceRepository.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Get-PSResourceRepository [[-Name] <String[]>] [<CommonParameters>]
1717
```
1818

1919
## DESCRIPTION
20-
The Get-PSResourceRepository cmdlet searches for the PowerShell resource repositories that are registered on the machine. By default it will return all registered repositories, or if the -Name parameter argument is specified then it will return the repository which matches that name. It returns PSRepositoryInfo objects which contain information for each repository item found.
20+
The Get-PSResourceRepository cmdlet searches for the PowerShell resource repositories that are registered on the machine. By default it will return all registered repositories, or if the `-Name` parameter argument is specified then it will return the repository which matches that name. It returns PSRepositoryInfo objects which contain information for each repository item found.
2121

2222
## EXAMPLES
2323

@@ -71,7 +71,7 @@ This example runs the command with the 'Name' parameter being set to a single wi
7171
## PARAMETERS
7272

7373
### -Name
74-
This parameter takes a String argument, including wildcard characters, or an array of such String arguments. It is used to search for repository names from the repository store which match the provided name pattern.
74+
This parameter takes a String argument, including wildcard characters, or an array of such String arguments. It is used to search for repository names from the repository store which match the provided name pattern. Tab completion is provided on this argument and will display registered repository names.
7575

7676
```yaml
7777
Type: String[]
@@ -91,9 +91,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
9191
## INPUTS
9292
9393
### System.String[]
94+
9495
## OUTPUTS
9596
9697
### Microsoft.PowerShell.PowerShellGet.UtilClasses.PSRepositoryInfo
98+
9799
## NOTES
98100
If no value for Name is provided, Get-PSResourceRepository will return information for all registered repositories.
99101

help/Register-PSResourceRepository.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Registers a repository for PowerShell resources.
1414

1515
### NameParameterSet (Default)
1616
```
17-
Register-PSResourceRepository [-Name] <String> [-URL] <Uri> [-Trusted] [-Priority <Int32>] [-PassThru]
17+
Register-PSResourceRepository [-Name] <String> [-URL] <String> [-Trusted] [-Priority <Int32>] [-PassThru]
1818
[-WhatIf] [-Confirm] [<CommonParameters>]
1919
```
2020

@@ -33,7 +33,7 @@ Register-PSResourceRepository -Repositories <Hashtable[]> [-PassThru] [-WhatIf]
3333
The Register-PSResourceRepository cmdlet registers a repository for PowerShell resources.
3434

3535
## EXAMPLES
36-
These examples assume that the repository we attempt to reigster is not already registered on the user's machine.
36+
These examples assume that the repository we attempt to register is not already registered on the user's machine.
3737
### Example 1
3838
```
3939
PS C:\> Register-PSResourceRepository -Name "PoshTestGallery" -URL "https://www.powershellgallery.com/api/v2"
@@ -43,7 +43,7 @@ PS C:\> Get-PSResourceRepository -Name "PoshTestGallery"
4343
PoshTestGallery https://www.poshtestgallery.com/api/v2 False 50
4444
```
4545

46-
This example registers the repository with the 'Name' of "PoshTestGallery" along with the associated 'URL' value for it.
46+
This example registers the repository with the `-Name` of "PoshTestGallery" along with the associated `URL` value for it.
4747

4848
### Example 2
4949
```
@@ -54,7 +54,7 @@ PS C:\> Get-PSResourceRepository -Name "PSGallery"
5454
PSGallery https://www.powershellgallery.com/api/v2 False 50
5555
```
5656

57-
This example registers the "PSGallery" repository, with the 'PSGallery' parameter. Unlike the previous example, we cannot use the 'Name' or 'URL' parameters to register the "PSGallery" repository as it is considered Powershell's default repository store and has its own value for URL.
57+
This example registers the "PSGallery" repository, with the 'PSGallery' parameter. Unlike the previous example, we cannot use the `-Name` or `-URL` parameters to register the "PSGallery" repository as it is considered Powershell's default repository store and has its own value for URL.
5858

5959
### Example 3
6060
```
@@ -68,12 +68,13 @@ PS C:\> Get-PSResourceRepository
6868
6969
```
7070

71-
This example registers multiple repositories at once. To do so, we use the 'Repositories' parameter and provide an array of hashtables. Each hashtable can only have keys associated with parameters for the NameParameterSet or the PSGalleryParameterSet. Upon running the command we can see that the "psgettestlocal" and "PSGallery" repositories have been succesfully registered.
71+
This example registers multiple repositories at once. To do so, we use the `-Repositories` parameter and provide an array of hashtables. Each hashtable can only have keys associated with parameters for the NameParameterSet or the PSGalleryParameterSet. Upon running the command we can see that the "psgettestlocal" and "PSGallery" repositories have been succesfully registered.
7272

7373
## PARAMETERS
7474

7575
### -Name
7676
Name of the repository to be registered.
77+
Cannot be "PSGallery".
7778

7879
```yaml
7980
Type: String
@@ -153,7 +154,7 @@ Specifies the location of the repository to be registered.
153154
URL can be of the following Uri schemas: HTTPS, HTTP, FTP, file share based.
154155
155156
```yaml
156-
Type: Uri
157+
Type: String
157158
Parameter Sets: NameParameterSet
158159
Aliases:
159160

@@ -216,12 +217,16 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
216217
## INPUTS
217218
218219
### System.String
219-
### System.Uri
220+
220221
## OUTPUTS
221222
222-
### Microsoft.PowerShell.PowerShellGet.UtilClasses.PSRepositoryInfo (if 'PassThru' parameter used)
223+
### Microsoft.PowerShell.PowerShellGet.UtilClasses.PSRepositoryInfo (if 'PassThru' parameter is used)
224+
223225
## NOTES
224226
Repositories are unique by 'Name'. Attempting to register a repository with same 'Name' as an already registered repository will not successfully register.
227+
225228
Registering the PSGallery repository must be done via the PSGalleryParameterSet (i.e by using the 'PSGallery' parameter instead of 'Name' and 'URL' parameters).
226229
230+
URL string input must be of one of the following Uri schemes: HTTP, HTTPS, FTP, File
231+
227232
## RELATED LINKS

help/Set-PSResourceRepository.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
external help file: PowerShellGet.dll-Help.xml
33
Module Name: PowerShellGet
4-
online version: <add>
4+
online version:
55
schema: 2.0.0
66
---
77

@@ -14,7 +14,7 @@ Sets information for a registered repository.
1414

1515
### NameParameterSet (Default)
1616
```
17-
Set-PSResourceRepository [-Name] <String> [-URL <Uri>] [-Trusted] [-Priority <Int32>] [-WhatIf] [-Confirm] [<CommonParameters>]
17+
Set-PSResourceRepository [-Name] <String> [-URL <String>] [-Trusted] [-Priority <Int32>] [-WhatIf] [-Confirm] [<CommonParameters>]
1818
```
1919

2020
### RepositoriesParameterSet
@@ -26,7 +26,7 @@ Set-PSResourceRepository -Repositories <Hashtable[]> [-Priority <Int32>] [-WhatI
2626
The Set-PSResourceRepository cmdlet sets information for a registered repository.
2727

2828
## EXAMPLES
29-
These examples are run independently of each other and assume the repositories used are already registered. The 'PassThru' parameter used with Set-PSResourceRepository is only used to display the changes made to the repository and is not mandatory.
29+
These examples are run independently of each other and assume the repositories used are already registered. The `-PassThru` parameter used with Set-PSResourceRepository is only used to display the changes made to the repository and is not mandatory.
3030
### Example 1
3131
```powershell
3232
PS C:\> Get-PSResourceRepository -Name "PoshTestGallery"
@@ -39,7 +39,7 @@ PS C:\> Set-PSResourceRepository -Name "PoshTestGallery" -URL "c:/code/testdir"
3939
PoshTestGallery file:///c:/code/testdir False 50
4040
```
4141

42-
This example first checks if the PoshTestGallery repository has been registered. We wish to set the 'URL' value of this repository by running the Set-PSResourceRepository cmdlet with the 'URL' parameter and a valid Uri scheme url. We run the Get-PSResourceRepository cmdlet again to ensure that the 'URL' of the repository was changed. We also use the 'PassThru' parameter to see the changed repository.
42+
This example first checks if the PoshTestGallery repository has been registered. We wish to set the `-URL` value of this repository by running the Set-PSResourceRepository cmdlet with the `-URL` parameter and a valid Uri scheme url. We run the Get-PSResourceRepository cmdlet again to ensure that the `-URL` of the repository was changed. We also use the `-PassThru` parameter to see the changed repository.
4343

4444
### Example 2
4545
```powershell
@@ -53,7 +53,7 @@ PS C:\> Set-PSResourceRepository -Name "PSGallery" -Priority 25 -Trusted -PassTh
5353
PSGallery https://www.powershellgallery.com/api/v2 True 25
5454
```
5555

56-
This example first checks if the PSGallery repository has been registered. We wish to set the 'Priority' and 'Trusted' values of this repository by running the Set-PSResourceRepository cmdlet with the 'Priority' parameter set to a value between 0 and 50 and by using the 'Trusted' parameter switch. We run the Get-PSResourceRepository cmdlet again to ensure that the 'Priority' and 'Trusted' values of the repository were changed. An important note here is that just for the default PSGallery repository, the 'URL' value can't be changed/set. We also use the 'PassThru' parameter to see the changed repository.
56+
This example first checks if the PSGallery repository has been registered. We wish to set the `-Priority` and `-Trusted` values of this repository by running the Set-PSResourceRepository cmdlet with the `-Priority` parameter set to a value between 0 and 50 and by using the `-Trusted` parameter switch. We run the Get-PSResourceRepository cmdlet again to ensure that the `-Priority` and `-Trusted` values of the repository were changed. An important note here is that just for the default PSGallery repository, the `-URL` value can't be changed/set. We also use the `-PassThru` parameter to see the changed repository.
5757

5858
### Example 3
5959
```powershell
@@ -62,15 +62,17 @@ PS C:\> Get-PSResourceRepository -Name "*"
6262
---- --- ------- --------
6363
PSGallery https://www.powershellgallery.com/api/v2 False 50
6464
PoshTestGallery https://www.poshtestgallery.com/api/v2 False 50
65+
6566
PS C:\> $arrayOfHashtables = @{Name = "PSGallery"; Trusted = $True},@{Name = "PoshTestGallery"; URL = "c:/code/testdir"}
67+
6668
PS C:\> Set-PSResourceRepository -Repositories $arrayOfHashtables -PassThru
6769
Name Url Trusted Priority
6870
---- --- ------- --------
6971
PSGallery https://www.powershellgallery.com/api/v2 True 50
7072
PoshTestGallery file:///c:/code/testdir False 50
7173
```
7274

73-
This example first checks for all registered repositories. We wish to set the properties for multiple repositories at once (i.e the PSGallery and PoshTestGallery repositories), so we run Set-PSResourceRepository with the 'Repositories' parameter. This parameter takes an array of hashtables, where each hashtable contains information for a repository we wish to set information for. We also use the 'PassThru' parameter to see the changed repositories.
75+
This example first checks for all registered repositories. We wish to set the properties for multiple repositories at once (i.e the PSGallery and PoshTestGallery repositories), so we run Set-PSResourceRepository with the `-Repositories` parameter. This parameter takes an array of hashtables, where each hashtable contains information for a repository we wish to set information for. We also use the `-PassThru` parameter to see the changed repositories.
7476

7577
## PARAMETERS
7678

@@ -105,7 +107,7 @@ Accept wildcard characters: False
105107
```
106108
107109
### -Repositories
108-
Specifies a hashtable of repositories and is used to register multiple repositories at once.
110+
Specifies a hashtable of repositories and is used to set multiple repositories at once.
109111
110112
```yaml
111113
Type: Hashtable[]
@@ -138,14 +140,14 @@ Accept wildcard characters: False
138140
Specifies the location of the repository to be set.
139141
140142
```yaml
141-
Type: System.Uri
143+
Type: String
142144
Parameter Sets: NameParameterSet
143145
Aliases:
144146

145147
Required: False
146148
Position: Named
147149
Default value: None
148-
Accept pipeline input: True (ByPropertyName)
150+
Accept pipeline input: False
149151
Accept wildcard characters: False
150152
```
151153
@@ -187,12 +189,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
187189
188190
### System.String
189191
190-
### System.Uri
191-
192192
### System.Collections.Hashtable[]
193193
194-
### System.Int32
195-
196194
## OUTPUTS
197195
198196
### Microsoft.PowerShell.PowerShellGet.UtilClasses.PSRepositoryInfo (if 'PassThru' parameter used)

help/Unregister-PSResourceRepository.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ PS C:\> Get-PSResourceRepository
4949
5050
```
5151

52-
In this example, the command to find all registered repositories is run and the repositories found are displayed. Next, the command to un-register is run with a list of names ("PoshTestGallery", "psgettestlocal") provided for the 'Name' parameter. Finally, the command to find all registered repositories is run again, but this time we can see that "PoshTestGallery" and "psgettestlocal" are not found and displayed as they have been successfully unregistered.
52+
In this example, the command to find all registered repositories is run and the repositories found are displayed. Next, the command to un-register is run with a list of names ("PoshTestGallery", "psgettestlocal") provided for the `-Name` parameter. Finally, the command to find all registered repositories is run again, but this time we can see that "PoshTestGallery" and "psgettestlocal" are not found and displayed as they have been successfully unregistered.
5353

5454
## PARAMETERS
5555

@@ -105,9 +105,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
105105
## INPUTS
106106
107107
### System.String[]
108+
108109
## OUTPUTS
109110
110111
None
112+
111113
## NOTES
112114
113115
## RELATED LINKS

help/Update-PSResource.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
external help file: PowerShellGet.dll-Help.xml
33
Module Name: PowerShellGet
4-
online version: <add>
4+
online version:
55
schema: 2.0.0
66
---
77

@@ -20,7 +20,7 @@ Update-PSResource [-Name] <String[]> [-Version <String>] [-Prerelease] [-Reposit
2020

2121
## DESCRIPTION
2222
The Update-PSResource cmdlet replaces the Update-Module and Update-Script cmdlets from V2.
23-
It updates an already installed package based on the -Name parameter argument.
23+
It updates an already installed package based on the `-Name` parameter argument.
2424
It does not return an object. Other parameters allow the package to be updated to be further filtered.
2525

2626
## EXAMPLES
@@ -32,8 +32,9 @@ PS C:\> Get-InstalledPSResource -Name "TestModule"
3232
---- ------- ---------- -----------
3333
TestModule 1.2.0 test
3434
35-
Update-PSResource -Name "TestModule"
36-
Get-InstalledPSResource -Name "TestModule"
35+
PS C:\> Update-PSResource -Name "TestModule"
36+
37+
PS C:\> Get-InstalledPSResource -Name "TestModule"
3738
Name Version Prerelease Description
3839
---- ------- ---------- -----------
3940
TestModule 1.3.0 test
@@ -169,6 +170,7 @@ Accept wildcard characters: False
169170
170171
### -Version
171172
Specifies the version the resource is to be updated to.
173+
Expected version/version range format is documented here: https://docs.microsoft.com/en-us/nuget/concepts/package-versioning#version-ranges
172174
173175
```yaml
174176
Type: System.String

0 commit comments

Comments
 (0)