Skip to content

Update help files for {Update, Find}-PSResource and {Register, Set, Get, Unregister}-PSResourceRepository #434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions help/Find-PSResource.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
---
external help file: PowerShellGet.dll-Help.xml
Module Name: PowerShellGet
online version: <add>
online version:
schema: 2.0.0
---

# Find-PSResource

## SYNOPSIS
Searches for packages from a repository (local or remote), based on Name or other package properties.

Searches for packages from a repository (local or remote), based on `-Name` and other package properties.

## SYNTAX

### ResourceNameParameterSet (Default)
``` PowerShell
[[-Name] <string[]>] [-Type <Microsoft.PowerShell.PowerShellGet.UtilClasses.ResourceType[]>] [-Version <string>] [-Prerelease] [-Tag <string[]>]
[-Repository <string[]>] [-Credential <pscredential>] [-IncludeDependencies] [-WhatIf] [-Confirm] [<CommonParameters>]
[[-Name] <string[]>] [-Type <Microsoft.PowerShell.PowerShellGet.UtilClasses.ResourceType[]>] [-Version <string>] [-Prerelease] [-Tag <string[]>] [-Repository <string[]>] [-Credential <pscredential>] [-IncludeDependencies] [-WhatIf] [-Confirm] [<CommonParameters>]
```

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

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

## EXAMPLES
These examples assume that the PSGallery repository is registered and contains the packages we are searching for.
Expand Down Expand Up @@ -162,7 +160,7 @@ Accept wildcard characters: False

### -Repository
Specifies one or more repository names to search.
If not specified, search will include all currently registered repositories, in order of highest priority, til first repository package is found in.
If not specified, search will include all currently registered repositories, in order of highest priority, until a repository is found that contains the package.

```yaml
Type: System.String[]
Expand Down Expand Up @@ -210,6 +208,7 @@ Accept wildcard characters: False

### -Version
Specifies the version of the resource to be returned.
Expected version/version range format is documented here: https://docs.microsoft.com/en-us/nuget/concepts/package-versioning#version-ranges

```yaml
Type: System.String
Expand Down Expand Up @@ -261,14 +260,6 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

### System.String[]

### System.String

### System.Management.Automation.PSCredential

### System.Management.Automation.SwitchParameter

### Microsoft.PowerShell.PowerShellGet.UtilClasses.ResourceType[]

## OUTPUTS

### Microsoft.PowerShell.PowerShellGet.UtilClasses.PSResourceInfo
Expand Down
6 changes: 4 additions & 2 deletions help/Get-PSResourceRepository.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Get-PSResourceRepository [[-Name] <String[]>] [<CommonParameters>]
```

## DESCRIPTION
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.
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.

## EXAMPLES

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

### -Name
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.
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.

```yaml
Type: String[]
Expand All @@ -91,9 +91,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## INPUTS

### System.String[]

## OUTPUTS

### Microsoft.PowerShell.PowerShellGet.UtilClasses.PSRepositoryInfo

## NOTES
If no value for Name is provided, Get-PSResourceRepository will return information for all registered repositories.

Expand Down
21 changes: 13 additions & 8 deletions help/Register-PSResourceRepository.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Registers a repository for PowerShell resources.

### NameParameterSet (Default)
```
Register-PSResourceRepository [-Name] <String> [-URL] <Uri> [-Trusted] [-Priority <Int32>] [-PassThru]
Register-PSResourceRepository [-Name] <String> [-URL] <String> [-Trusted] [-Priority <Int32>] [-PassThru]
[-WhatIf] [-Confirm] [<CommonParameters>]
```

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

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

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

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

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.
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.

### Example 3
```
Expand All @@ -68,12 +68,13 @@ PS C:\> Get-PSResourceRepository

```

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.
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.

## PARAMETERS

### -Name
Name of the repository to be registered.
Cannot be "PSGallery".

```yaml
Type: String
Expand Down Expand Up @@ -153,7 +154,7 @@ Specifies the location of the repository to be registered.
URL can be of the following Uri schemas: HTTPS, HTTP, FTP, file share based.

```yaml
Type: Uri
Type: String
Parameter Sets: NameParameterSet
Aliases:

Expand Down Expand Up @@ -216,12 +217,16 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## INPUTS

### System.String
### System.Uri

## OUTPUTS

### Microsoft.PowerShell.PowerShellGet.UtilClasses.PSRepositoryInfo (if 'PassThru' parameter used)
### Microsoft.PowerShell.PowerShellGet.UtilClasses.PSRepositoryInfo (if 'PassThru' parameter is used)

## NOTES
Repositories are unique by 'Name'. Attempting to register a repository with same 'Name' as an already registered repository will not successfully register.

Registering the PSGallery repository must be done via the PSGalleryParameterSet (i.e by using the 'PSGallery' parameter instead of 'Name' and 'URL' parameters).

URL string input must be of one of the following Uri schemes: HTTP, HTTPS, FTP, File

## RELATED LINKS
24 changes: 11 additions & 13 deletions help/Set-PSResourceRepository.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
external help file: PowerShellGet.dll-Help.xml
Module Name: PowerShellGet
online version: <add>
online version:
schema: 2.0.0
---

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

### NameParameterSet (Default)
```
Set-PSResourceRepository [-Name] <String> [-URL <Uri>] [-Trusted] [-Priority <Int32>] [-WhatIf] [-Confirm] [<CommonParameters>]
Set-PSResourceRepository [-Name] <String> [-URL <String>] [-Trusted] [-Priority <Int32>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

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

## EXAMPLES
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.
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.
### Example 1
```powershell
PS C:\> Get-PSResourceRepository -Name "PoshTestGallery"
Expand All @@ -39,7 +39,7 @@ PS C:\> Set-PSResourceRepository -Name "PoshTestGallery" -URL "c:/code/testdir"
PoshTestGallery file:///c:/code/testdir False 50
```

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.
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.

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

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.
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.

### Example 3
```powershell
Expand All @@ -62,15 +62,17 @@ PS C:\> Get-PSResourceRepository -Name "*"
---- --- ------- --------
PSGallery https://www.powershellgallery.com/api/v2 False 50
PoshTestGallery https://www.poshtestgallery.com/api/v2 False 50

PS C:\> $arrayOfHashtables = @{Name = "PSGallery"; Trusted = $True},@{Name = "PoshTestGallery"; URL = "c:/code/testdir"}

PS C:\> Set-PSResourceRepository -Repositories $arrayOfHashtables -PassThru
Name Url Trusted Priority
---- --- ------- --------
PSGallery https://www.powershellgallery.com/api/v2 True 50
PoshTestGallery file:///c:/code/testdir False 50
```

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.
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.

## PARAMETERS

Expand Down Expand Up @@ -105,7 +107,7 @@ Accept wildcard characters: False
```

### -Repositories
Specifies a hashtable of repositories and is used to register multiple repositories at once.
Specifies a hashtable of repositories and is used to set multiple repositories at once.

```yaml
Type: Hashtable[]
Expand Down Expand Up @@ -138,14 +140,14 @@ Accept wildcard characters: False
Specifies the location of the repository to be set.

```yaml
Type: System.Uri
Type: String
Parameter Sets: NameParameterSet
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept pipeline input: False
Accept wildcard characters: False
```

Expand Down Expand Up @@ -187,12 +189,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

### System.String

### System.Uri

### System.Collections.Hashtable[]

### System.Int32

## OUTPUTS

### Microsoft.PowerShell.PowerShellGet.UtilClasses.PSRepositoryInfo (if 'PassThru' parameter used)
Expand Down
4 changes: 3 additions & 1 deletion help/Unregister-PSResourceRepository.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ PS C:\> Get-PSResourceRepository

```

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.
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.

## PARAMETERS

Expand Down Expand Up @@ -105,9 +105,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## INPUTS

### System.String[]

## OUTPUTS

None

## NOTES

## RELATED LINKS
10 changes: 6 additions & 4 deletions help/Update-PSResource.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
external help file: PowerShellGet.dll-Help.xml
Module Name: PowerShellGet
online version: <add>
online version:
schema: 2.0.0
---

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

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

## EXAMPLES
Expand All @@ -32,8 +32,9 @@ PS C:\> Get-InstalledPSResource -Name "TestModule"
---- ------- ---------- -----------
TestModule 1.2.0 test

Update-PSResource -Name "TestModule"
Get-InstalledPSResource -Name "TestModule"
PS C:\> Update-PSResource -Name "TestModule"

PS C:\> Get-InstalledPSResource -Name "TestModule"
Name Version Prerelease Description
---- ------- ---------- -----------
TestModule 1.3.0 test
Expand Down Expand Up @@ -169,6 +170,7 @@ Accept wildcard characters: False

### -Version
Specifies the version the resource is to be updated to.
Expected version/version range format is documented here: https://docs.microsoft.com/en-us/nuget/concepts/package-versioning#version-ranges

```yaml
Type: System.String
Expand Down