These examples will go through a number of scenarios related to Find-PSResource searching through repositories to show what the expected outcome will be. Find-PSResource will return resources from all repositories that match the criteria specified.
In all these examples, the repositories registered and their priorities are as follows:
Name Uri Trusted Priority
---- --- ------- --------
PSGallery https://www.powershellgallery.com/api/v2 True 50
NuGetGallery https://api.nuget.org/v3/index.json True 60
Note that PSGallery has a lower priority than NuGetGallery.
-
Searching with only a package name specified, eg:
Find-PSResource 'TestModule'orFind-PSResource 'TestModule' -Repository '*'-
When the package exists in both repositories:
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGallery TestModule 1.0.0.0 NuGetGalleryShould return 'TestModule' from both 'PSGallery' and 'NuGetGallery'.
-
When the package exists in the first repository (PSGallery), but not the second (NuGetGallery):
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'.
-
When the package exists in the second repository (NuGetGallery), but not the first (PSGallery):
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 NuGetGalleryShould return 'TestModule' from 'NuGetGallery'.
-
When the package exists in neither repository:
Find-PSResource: Package 'TestModule' could not be found in any registered repositories.
-
-
Searching with a package name and a repository specified, eg:
Find-PSResource 'TestModule' -Repository PSGallery-
When the package exists in both repositories:
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'.
-
When the package exists in the first repository (PSGallery), but not the second (NuGetGallery):
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'.
-
When the package exists in the second repository (NuGetGallery), but not the first (PSGallery):
Find-PSResource: Package with name 'TestModule' could not be found in repository 'PSGallery'. -
When the package exists in neither repository:
Find-PSResource: Package with name 'TestModule' could not be found in repository 'PSGallery'.
-
-
Searching with a package name specified and wildcard repository, eg:
Find-PSResource 'TestModule' -Repository *Gallery-
When the package exists in both repositories:
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGallery TestModule 1.0.0.0 NuGetGalleryShould return 'TestModule' from 'PSGallery' and 'NuGetGallery'.
-
When the package exists in the first repository (PSGallery), but not the second (NuGetGallery):
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'.
-
When the package exists in the second repository (NuGetGallery), but not the first (PSGallery):
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 NuGetGalleryShould return 'TestModule' from 'NuGetGallery'.
-
When the package exists in neither repository:
Find-PSResource: Package 'TestModule' could not be found in registered repositories: 'PSGallery, NuGetGallery'.
-
-
Searching with a package name specified and multiple repository names specified, eg:
Find-PSResource 'TestModule' -Repository PSGallery, NuGetGallery-
When the package exists in both repositories:
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGallery TestModule 1.0.0.0 NuGetGalleryShould return 'TestModule' from 'PSGallery' and 'NuGetGallery'.
-
When the package exists in the first repository (PSGallery), but not the second (NuGetGallery):
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGallery Find-PSResource: Package with name 'TestModule' could not be found in repository 'NuGetGallery'.Should return 'TestModule' from 'PSGallery'.
-
When the package exists the second repository (NuGetGallery), but not the first (PSGallery):
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 NuGetGallery Find-PSResource: Package with name 'TestModule' could not be found in repository 'PSGallery'.Should return 'TestModule' from 'NuGetGallery'.
-
When the package is in neither repository:
Find-PSResource: Package with name 'TestModule' could not be found in repository 'PSGallery'. Find-PSResource: Package with name 'TestModule' could not be found in repository 'NuGetGallery'.
-
-
Searching with a package name specified and both a repository name specified AND a repository name with a wildcard, eg:
Find-PSResource 'TestModule' -Repository *Gallery, otherRepository- This scenario is not supported due to the ambiguity that arises when a repository with a wildcard in its name is specified as well as a repository with a specific name. The command will display the following error:
Find-PSResource: Repository name with wildcard is not allowed when another repository without wildcard is specified.
- This scenario is not supported due to the ambiguity that arises when a repository with a wildcard in its name is specified as well as a repository with a specific name. The command will display the following error:
In these examples, the package TestModule has the following tags: Tag1, Tag2.
-
Searching with only a tag specified, eg:
Find-PSResource -Tag 'Tag1'orFind-PSResource -Tag 'Tag1' -Repository '*'-
When the package exists in both repositories:
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGallery TestModule 1.0.0.0 NuGetGalleryShould return 'TestModule' from both 'PSGallery' and 'NuGetGallery'.
-
When the package exists in the first repository (PSGallery), but not the second (NuGetGallery):
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'.
-
When the package exists in the second repository (NuGetGallery), but not the first (PSGallery):
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 NuGetGalleryShould return 'TestModule' from 'NuGetGallery'.
-
When the package exists in neither repository:
Find-PSResource: Package with Tags 'Tag1' could not be found in any registered repositories. -
When the package exists in both repositories and multiple existing tags are specified:
eg:
Find-PSResource -Tag 'Tag1','Tag2'orFind-PSResource -Tag 'Tag1','Tag2' -Repository '*'Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGallery TestModule 1.0.0.0 NuGetGalleryShould return 'TestModule' from both 'PSGallery' and 'NuGetGallery'.
-
When the package exists in both repositories and multiple tags (existing and non-existant) are specified:
eg:
Find-PSResource -Tag 'Tag1','NonExistentTag'orFind-PSResource -Tag 'Tag1','NonExistentTag' -Repository '*'Find-PSResource: Package with Tags 'Tag1, NonExistentTag' could not be found in any registered repositories.
-
-
Searching with a tag and a repository specified, eg:
Find-PSResource -Tag 'Tag1' -Repository PSGallery-
When the package exists in both repositories:
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'.
-
When the package exists in the first repository (PSGallery), but not the second (NuGetGallery):
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'.
-
When the package exists in the second repository (NuGetGallery), but not the first (PSGallery):
Package with Tags 'Tag1' could not be found in repository 'PSGallery'. -
When the package exists in neither repository:
Package with Tags 'Tag1' could not be found in repository 'PSGallery'. -
When the package exists in the first repository (PSGallery), but not the second (NuGetGallery) and multiple existing tags are specified:
eg:
Find-PSResource -Tag 'Tag1','Tag2' -Repository PSGalleryName Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from both 'PSGallery'.
-
When the package exists in the first repository (PSGallery), but not the second (NuGetGallery) and multiple tags (existing and non-existant) are specified:
eg:
Find-PSResource -Tag 'Tag1','NonExistentTag' -Repository PSGalleryFind-PSResource: Package with Tags 'Tag1, NonExistentTag' could not be found in repository 'PSGallery'.
-
-
Searching with a tag specified and wildcard repository, eg:
Find-PSResource -Tag 'Tag1' -Repository *Gallery-
When the package exists in both repositories:
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGallery TestModule 1.0.0.0 NuGetGalleryShould return 'TestModule' from 'PSGallery' and 'NuGetGallery'.
-
When the package exists in the first repository (PSGallery), but not the second (NuGetGallery):
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'.
-
When the package exists in the second repository (NuGetGallery), but not the first (PSGallery):
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 NuGetGalleryShould return 'TestModule' from 'NuGetGallery'.
-
When the package exists in neither repository:
Find-PSResource: Package with Tags 'Tag1' could not be found in registered repositories: 'PSGallery, NuGetGallery'. -
When the package exists in both repositories and multiple existing tags are specified:
eg:
Find-PSResource -Tag 'Tag1','Tag2' -Repository *GalleryName Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGallery TestModule 1.0.0.0 NuGetGalleryShould return 'TestModule' from 'PSGallery' and 'NuGetGallery'.
-
When the package exists in both repositories and multiple tags (existing and non-existant) are specified:
eg:
Find-PSResource -Tag 'Tag1','NonExistentTag' -Repository *GalleryFind-PSResource: Package with Tags 'Tag1, NonExistentTag' could not be found in registered repositories: 'PSGallery, NuGetGallery'.
-
-
Searching with a tag specified and multiple repository names specified, eg:
Find-PSResource -Tag 'Tag1' -Repository PSGallery, NuGetGallery-
When the package exists in both repositories:
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGallery TestModule 1.0.0.0 NuGetGalleryShould return 'TestModule' from 'PSGallery' and 'NuGetGallery'.
-
When the package exists in the first repository (PSGallery), but not the second (NuGetGallery):
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGallery Find-PSResource: Package with Tags 'Tag1' could not be found in repository 'NuGetGallery'.Should return 'TestModule' from 'PSGallery'.
-
When the package exists the second repository (NuGetGallery), but not the first (PSGallery):
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 NuGetGallery Find-PSResource: Package with Tags 'Tag1' could not be found in repository 'PSGallery'.Should return 'TestModule' from 'NuGetGallery'.
-
When the package is in neither repository:
Find-PSResource: Package with Tags 'Tag1' could not be found in repository 'PSGallery'. Find-PSResource: Package with Tags 'Tag1' could not be found in repository 'NuGetGallery'. -
When the package exists in both repositories and multiple existing tags are specified:
eg:
Find-PSResource -Tag 'Tag1','Tag2' -Repository PSGallery, NuGetGalleryName Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGallery TestModule 1.0.0.0 NuGetGalleryShould return 'TestModule' from 'PSGallery' and 'NuGetGallery'.
-
When the package exists in both repositories and multiple tags (existing and non-existant) are specified:
eg:
Find-PSResource -Tag 'Tag1','NonExistentTag' -Repository PSGallery, NuGetGalleryFind-PSResource: Package with Tags 'Tag1, NonExistentTag' could not be found in registered repositories: 'PSGallery, NuGetGallery'.
-
-
Searching with a tag specified and both a repository name specified AND a repository name with a wildcard, eg:
Find-PSResource -Tag 'Tag1' -Repository *Gallery, otherRepository- This scenario is not supported due to the ambiguity that arises when a repository with a wildcard in its name is specified as well as a repository with a specific name. The command will display the following error:
Find-PSResource: Repository name with wildcard is not allowed when another repository without wildcard is specified.
- This scenario is not supported due to the ambiguity that arises when a repository with a wildcard in its name is specified as well as a repository with a specific name. The command will display the following error:
In these examples, the package TestModule has the following command names (i.e tag prepended with "PSCommand_"): Get-MyCommand1, Get-MyCommand2.
-
Searching with only a Command name specified, eg:
Find-PSResource -CommandName 'Get-MyCommand1'orFind-PSResource -CommandName 'Get-MyCommand1' -Repository '*'-
When the package exists in both repositories:
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'. Since searching with
-CommandNamefor NuGetGallery repository is not supported, it will be skipped. -
When the package exists in the first repository (PSGallery), but not the second (NuGetGallery):
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'. Since searching with
-CommandNamefor NuGetGallery repository is not supported, it will be skipped. -
When the package exists in the second repository (NuGetGallery), but not the first (PSGallery):
Find-PSResource: Package with CommandName 'Get-MyCommand1' could not be found in any registered repositories.Since searching with
-CommandNamefor NuGetGallery repository is not supported, it will be skipped. -
When the package exists in neither repository:
Find-PSResource: Package with CommandName 'Get-MyCommand1' could not be found in any registered repositories.Since searching with
-CommandNamefor NuGetGallery repository is not supported, it will be skipped. -
When the package exists in both repositories and multiple existing Command names are specified:
eg:
Find-PSResource -CommandName 'Get-MyCommand1','Get-MyCommand2'orFind-PSResource -CommandName 'Get-MyCommand1','Get-MyCommand2' -Repository '*'Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from both 'PSGallery'. Since searching with
-CommandNamefor NuGetGallery repository is not supported, it will be skipped. -
When the package exists in both repositories and multiple Command names (existing and non-existant) are specified:
eg:
Find-PSResource -CommandName 'Get-MyCommand1','NonExistentCommand'orFind-PSResource -CommandName 'Get-MyCommand1','NonExistentCommand' -Repository '*'Find-PSResource: Package with CommandName 'Get-MyCommand1, NonExistentCommand' could not be found in any registered repositories.
-
-
Searching with a Command name and a repository specified, eg:
Find-PSResource -CommandName 'Get-MyCommand1' -Repository PSGallery-
When the package exists in both repositories:
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'.
-
When the package exists in the first repository (PSGallery), but not the second (NuGetGallery):
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'.
-
When the package exists in the second repository (NuGetGallery), but not the first (PSGallery):
Package with CommandName 'Get-MyCommand1' could not be found in repository 'PSGallery'. -
When the package exists in neither repository:
Package with CommandName 'Get-MyCommand1' could not be found in repository 'PSGallery'. -
When the package exists in the first repository (PSGallery), but not the second (NuGetGallery) and multiple existing tags are specified:
eg:
Find-PSResource -CommandName 'Get-MyCommand1','Get-MyCommand2' -Repository PSGalleryName Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'.
-
When the package exists in the first repository (PSGallery), but not the second (NuGetGallery) and multiple tags (existing and non-existant) are specified:
eg:
Find-PSResource -CommandName 'Get-MyCommand1','NonExistentCommand' -Repository PSGalleryFind-PSResource: Package with CommandName 'Get-MyCommand1, Get-MyCommand2' could not be found in repository 'PSGallery'.
-
-
Searching with a Command name specified and wildcard repository, eg:
Find-PSResource -CommandName 'Get-MyCommand1' -Repository *Gallery-
When the package exists in both repositories:
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'. Since searching with
-CommandNamefor NuGetGallery repository is not supported, it will be skipped. -
When the package exists in the first repository (PSGallery), but not the second (NuGetGallery):
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'.
-
When the package exists in the second repository (NuGetGallery), but not the first (PSGallery):
Find-PSResource: Package with CommandName 'Get-MyCommand1' could not be found in any registered repositories.Since searching with
-CommandNamefor NuGetGallery repository is not supported, it will be skipped. -
When the package exists in neither repository:
Find-PSResource: Package with CommandName 'Get-MyCommand1' could not be found in registered repositories: 'PSGallery, NuGetGallery'. -
When the package exists in both repositories and multiple existing Command names are specified:
eg:
Find-PSResource -CommandName 'Get-MyCommand1','Get-MyCommand2' -Repository *GalleryName Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'. Since searching with
-CommandNamefor NuGetGallery repository is not supported, it will be skipped. -
When the package exists in both repositories and multiple Command names (existing and non-existant) are specified:
eg:
Find-PSResource -Tag 'Get-MyCommand1','NonExistentCommand' -Repository *GalleryFind-PSResource: Package with CommandName 'Get-MyCommand1, NonExistentCommand' could not be found in registered repositories: 'PSGallery, NuGetGallery'.
-
-
Searching with a Command name specified and multiple repository names specified, eg:
Find-PSResource -CommandName 'Get-MyCommand1' -Repository PSGallery, NuGetGallery-
When the package exists in both repositories:
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'. Since searching with
-CommandNamefor NuGetGallery repository is not supported, it will be skipped. -
When the package exists in the first repository (PSGallery), but not the second (NuGetGallery):
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGallery Find-PSResource: Find by CommandName or DSCResource is not supported for the V3 server protocol repository 'NuGetGallery'.Should return 'TestModule' from 'PSGallery'. Since searching with
-CommandNamefor NuGetGallery repository is not supported, it will not be searched and error written out. -
When the package exists the second repository (NuGetGallery), but not the first (PSGallery):
Find-PSResource: Find by CommandName or DSCResource is not supported for the V3 server protocol repository 'NuGetGallery'.Since searching with
-CommandNamefor NuGetGallery repository is not supported, it will not be searched and error written out. -
When the package is in neither repository:
Find-PSResource: Package with Command 'Get-MyCommand1' could not be found in repository 'PSGallery'. Find-PSResource: Find by CommandName or DSCResource is not supported for the V3 server protocol repository 'NuGetGallery'.Since searching with
-CommandNamefor NuGetGallery repository, it will not be searched and error written out. -
When the package exists in both repositories and multiple existing Command names are specified:
eg:
Find-PSResource -CommandName 'Get-MyCommand1','Get-MyCommand2' -Repository PSGallery, NuGetGalleryName Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGallery Find-PSResource: Find by CommandName or DSCResource is not supported for the V3 server protocol repository 'NuGetGallery'.Since searching with
-CommandNamefor NuGetGallery repository, it will not be searched and error written out. -
When the package exists in both repositories and multiple Command names (existing and non-existant) are specified:
eg:
Find-PSResource -CommandName 'Get-MyCommand1','NonExistentCommand' -Repository PSGallery, NuGetGalleryFind-PSResource: Package with Command 'Get-MyCommand1' could not be found in repository 'PSGallery'. Find-PSResource: Find by CommandName or DSCResource is not supported for the V3 server protocol repository 'NuGetGallery'.Since searching with
-CommandNamefor NuGetGallery repository, it will not be searched and error written out.
-
-
Searching with a Command name specified and both a repository name specified AND a repository name with a wildcard, eg:
Find-PSResource -CommandName 'Get-MyCommand1' -Repository *Gallery, otherRepository- This scenario is not supported due to the ambiguity that arises when a repository with a wildcard in its name is specified as well as a repository with a specific name. The command will display the following error:
Find-PSResource: Repository name with wildcard is not allowed when another repository without wildcard is specified.
- This scenario is not supported due to the ambiguity that arises when a repository with a wildcard in its name is specified as well as a repository with a specific name. The command will display the following error:
In these examples, the package TestModule has the following DscResource names (i.e tag prepended with "PSDscResource_"): MyDscResource1, MyDscResource2.
-
Searching with only a DscResource name specified, eg:
Find-PSResource -DscResourceName 'MyDscResource1'orFind-PSResource -DscResourceName 'MyDscResource1' -Repository '*'-
When the package exists in both repositories:
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'. Since searching with
-DscResourceNamefor NuGetGallery repository is not supported, it will be skipped. -
When the package exists in the first repository (PSGallery), but not the second (NuGetGallery):
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'. Since searching with
-DscResourceNamefor NuGetGallery repository is not supported, it will be skipped. -
When the package exists in the second repository (NuGetGallery), but not the first (PSGallery):
Find-PSResource: Package with DSCResourceName 'MyDscResource1' could not be found in any registered repositories.Since searching with
-DscResourceNamefor NuGetGallery repository is not supported, it will be skipped. -
When the package exists in neither repository:
Find-PSResource: Package with DSCResourceName 'MyDscResource1' could not be found in any registered repositories.Since searching with
-DSCResourceNamefor NuGetGallery repository is not supported, it will be skipped. -
When the package exists in both repositories and multiple existing DSCResource names are specified:
eg:
Find-PSResource -DSCResourceName 'MyDscResource1','MyDscResource2'orFind-PSResource -DSCResourceName 'MyDscResource1', 'MyDscResource2' -Repository '*'Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from both 'PSGallery'. Since searching with
-DscResourceNamefor NuGetGallery repository is not supported, it will be skipped. -
When the package exists in both repositories and multiple DscResource names (existing and non-existant) are specified:
eg:
Find-PSResource -DscResourceName 'MyDscResource1','NonExistentDscResource'orFind-PSResource -DSCResourceName 'MyDscResource1','NonExistentDscResource' -Repository '*'Find-PSResource: Package with DSCResourceName 'MyDscResource1, NonExistentDscResource' could not be found in any registered repositories.
-
-
Searching with a DscResource name and a repository specified, eg:
Find-PSResource -DscResourceName 'MyDscResource1' -Repository PSGallery-
When the package exists in both repositories:
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'.
-
When the package exists in the first repository (PSGallery), but not the second (NuGetGallery):
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'.
-
When the package exists in the second repository (NuGetGallery), but not the first (PSGallery):
Package with DscResourceName 'MyDscResource1' could not be found in repository 'PSGallery'. -
When the package exists in neither repository:
Package with DSCResourceName 'MyDscResource1' could not be found in repository 'PSGallery'. -
When the package exists in the first repository (PSGallery), but not the second (NuGetGallery) and multiple existing tags are specified:
eg:
Find-PSResource -DscResourceName 'MyDscResource1','MyDscResource2' -Repository PSGalleryName Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'.
-
When the package exists in the first repository (PSGallery), but not the second (NuGetGallery) and multiple tags (existing and non-existant) are specified:
eg:
Find-PSResource -DscResourceName 'MyDscResource1','NonExistentDscResource' -Repository PSGalleryFind-PSResource: Package with DSCResourceName 'MyDscResource1, MyDscResource2' could not be found in repository 'PSGallery'.
-
-
Searching with a DscResource name specified and wildcard repository, eg:
Find-PSResource -DscResourceName 'MyDscResource1' -Repository *Gallery-
When the package exists in both repositories:
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'. Since searching with
-DscResourceNamefor NuGetGallery repository is not supported, it will be skipped. -
When the package exists in the first repository (PSGallery), but not the second (NuGetGallery):
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'.
-
When the package exists in the second repository (NuGetGallery), but not the first (PSGallery):
Find-PSResource: Package with DSCResourceName 'MyDscResource1' could not be found in any registered repositories.Since searching with
-DscResourceNamefor NuGetGallery repository is not supported, it will be skipped. -
When the package exists in neither repository:
Find-PSResource: Package with DSCResourceName 'MyDscResource1' could not be found in registered repositories: 'PSGallery, NuGetGallery'. -
When the package exists in both repositories and multiple existing DscResource names are specified:
eg:
Find-PSResource -DscResourceName 'MyDscResource1','MyDscResource2' -Repository *GalleryName Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'. Since searching with
-DscResourceNamefor NuGetGallery repository is not supported, it will be skipped. -
When the package exists in both repositories and multiple DscResource names (existing and non-existant) are specified:
eg:
Find-PSResource -Tag 'MyDscResource1','NonExistentDscResource' -Repository *GalleryFind-PSResource: Package with DSCResourceName 'MyDscResource1, NonExistentDscResource' could not be found in registered repositories: 'PSGallery, NuGetGallery'.
-
-
Searching with a DscResource name specified and multiple repository names specified, eg:
Find-PSResource -DscResourceName 'MyDscResource1' -Repository PSGallery, NuGetGallery-
When the package exists in both repositories:
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGalleryShould return 'TestModule' from 'PSGallery'. Since searching with
-DscResourceNamefor NuGetGallery repository is not supported, it will be skipped. -
When the package exists in the first repository (PSGallery), but not the second (NuGetGallery):
Name Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGallery Find-PSResource: Find by DscResourceName or DSCResource is not supported for the V3 server protocol repository 'NuGetGallery'.Should return 'TestModule' from 'PSGallery'. Since searching with
-DscResourceNamefor NuGetGallery repository is not supported, it will not be searched and error written out. -
When the package exists the second repository (NuGetGallery), but not the first (PSGallery):
Find-PSResource: Find by DscResourceName or DSCResource is not supported for the V3 server protocol repository 'NuGetGallery'.Since searching with
-DscResourceNamefor NuGetGallery repository is not supported, it will not be searched and error written out. -
When the package is in neither repository:
Find-PSResource: Package with DSCResourceName 'MyDscResource1' could not be found in repository 'PSGallery'. Find-PSResource: Find by CommandName or DSCResource is not supported for the V3 server protocol repository 'NuGetGallery'.Since searching with
-DscResourceNamefor NuGetGallery repository, it will not be searched and error written out. -
When the package exists in both repositories and multiple existing DscResource names are specified:
eg:
Find-PSResource -DscResourceName 'MyDscResource1','MyDscResource2' -Repository PSGallery, NuGetGalleryName Version Prerelease Repository ---- ------- ---------- ---------- TestModule 1.0.0.0 PSGallery Find-PSResource: Find by CommandName or DSCResource is not supported for the V3 server protocol repository 'NuGetGallery'.Since searching with
-DscResourceNamefor NuGetGallery repository, it will not be searched and error written out. -
When the package exists in both repositories and multiple DscResource names (existing and non-existant) are specified:
eg:
Find-PSResource -DscResourceName 'MyDscResource1','NonExistentDscResource' -Repository PSGallery, NuGetGalleryFind-PSResource: Package with DscResource 'MyDscResource1' could not be found in repository 'PSGallery'. Find-PSResource: Find by CommandName or DSCResource is not supported for the V3 server protocol repository 'NuGetGallery'.Since searching with
-DscResourceNamefor NuGetGallery repository, it will not be searched and error written out.
-
-
Searching with a DscResource name specified and both a repository name specified AND a repository name with a wildcard, eg:
Find-PSResource -DscResourceName 'MyDscResource1' -Repository *Gallery, otherRepository- This scenario is not supported due to the ambiguity that arises when a repository with a wildcard in its name is specified as well as a repository with a specific name. The command will display the following error:
Find-PSResource: Repository name with wildcard is not allowed when another repository without wildcard is specified.
- This scenario is not supported due to the ambiguity that arises when a repository with a wildcard in its name is specified as well as a repository with a specific name. The command will display the following error: