From 772b20470500a6bde656802ac4770aba1e80a788 Mon Sep 17 00:00:00 2001 From: Amber Erickson Date: Thu, 2 Dec 2021 10:01:32 -0800 Subject: [PATCH 1/3] Update install, save, uninstall, unregister, update help docs --- Docs/DesignDoc.md | 74 ------ Docs/FindPSResource.md | 305 ----------------------- Docs/GetPSResource.md | 148 ----------- Docs/GetPSResourceRepository.md | 78 ------ Docs/InstallPSResource.md | 263 -------------------- Docs/PublishPSResource.md | 310 ------------------------ Docs/RegisterPSResourceRepository.md | 176 -------------- Docs/SavePSResource.md | 205 ---------------- Docs/SetPSResourceRepository.md | 174 ------------- Docs/UninstallPSResource.md | 101 -------- Docs/UnregisterPSResourceRepository.md | 69 ------ Docs/UpdatePSResource.md | 217 ----------------- help/Install-PSResource.md | 88 ++++++- help/Save-PSResource.md | 97 +++++++- help/Uninstall-PSResource.md | 35 ++- help/Unregister-PSResourceRepository.md | 18 +- help/Update-PSResource.md | 47 +++- src/code/InstallPSResource.cs | 23 +- src/code/SavePSResource.cs | 15 +- src/code/UpdatePSResource.cs | 2 +- 20 files changed, 272 insertions(+), 2173 deletions(-) delete mode 100644 Docs/DesignDoc.md delete mode 100644 Docs/FindPSResource.md delete mode 100644 Docs/GetPSResource.md delete mode 100644 Docs/GetPSResourceRepository.md delete mode 100644 Docs/InstallPSResource.md delete mode 100644 Docs/PublishPSResource.md delete mode 100644 Docs/RegisterPSResourceRepository.md delete mode 100644 Docs/SavePSResource.md delete mode 100644 Docs/SetPSResourceRepository.md delete mode 100644 Docs/UninstallPSResource.md delete mode 100644 Docs/UnregisterPSResourceRepository.md delete mode 100644 Docs/UpdatePSResource.md diff --git a/Docs/DesignDoc.md b/Docs/DesignDoc.md deleted file mode 100644 index fc8ddcbd3..000000000 --- a/Docs/DesignDoc.md +++ /dev/null @@ -1,74 +0,0 @@ -# PowerShellGet V3 Module Design - -## Description - -PowerShellGet V3 is an upgrade to the currently available V2 module. -The V2 module is completely script based, and has dependencies on other PowerShell modules(PackageManagement). - -This version directly uses NuGet APIs, via NuGet managed code binaries. - -For more information, see [Re-architecting PowerShellGet - the PowerShell package manager](https://github.com/PowerShell/PowerShell-RFC/pull/185). - -## Goals - -- Works side by side with current PowerShellGet V2 module - -- Remove dependency on PackageManagement module, and directly use NuGet APIs - -- Leverage the latest NuGet V3 APIs - -- Provide cmdlets that perform similar functions but do not interfere with V2 cmdlets - -- Implement as binary cmdlets and minimize use of PowerShell scripts - -- Remove unneeded components (DscResources). TODO: Discuss with Sydney and Steve. - -- Minimize binary dependencies - -- Work over all PowerShell supported platforms - -- Minimize code duplication - -- Have only one .NET dependency (netstandard2.0) for Windows 5.x compatibility - -## Compatibility Module - -### Update module as needed - -### Write/update tests as needed - -## Summary of work estimates - -### Cmdlet work estimates - -TODO: - -### Compatibility Module work estimates - -TODO: - -## Cmdlets - -### Find-PSResource - -[Find-PSResource](./FindPSResource.md) - -### Get-PSResource - -### Get-PSResourceRepository - -### Install-PSResource - -### Publish-PSResource - -### Register-PSResourceRepository - -### Save-PSResource - -### Set-PSResourceRepository - -### Uninstall-PSResource - -### Unregister-PSResourceRepository - -### Update-PSResource diff --git a/Docs/FindPSResource.md b/Docs/FindPSResource.md deleted file mode 100644 index aebf29349..000000000 --- a/Docs/FindPSResource.md +++ /dev/null @@ -1,305 +0,0 @@ -# Find-PSResource - -The `Find-PSResource` cmdlet combines the `Find-Module, Find-Script, Find-DscResource, Find-Command` cmdlets from V2. -It performs a search on a repository (local or remote) based on the `-Name` parameter argument. -It returns `PSResourceInfo` objects which describe each resource item found (with Name, Version, Prerelease and Description information displayed, but other properties available too). -Other parameters allow the returned results to be filtered by item Type, Tag, Version and IncludeDependencies. - -Alternatively, a `-CommandName` or `-DscResourceName` can be provided and resource packages having those commands or Dsc resources will be returned. This has not been implemented yet. -The `-ModuleName` parameter allows the command or dsc resource name search to be limited to a subset of module packages. This has not been implemented yet. - -## Syntax - -### ResourceNameParameterSet (Default) -``` PowerShell -[[-Name] ] [-Type ] [-Version ] [-Prerelease] [-Tag ] -[-Repository ] [-Credential ] [-IncludeDependencies] [-WhatIf] [-Confirm] [] -``` - -### CommandNameParameterSet -``` PowerShell -[[-CommandName] ] [-ModuleName ] [-Version ] [-Prerelease] [-Tag ] -[-Repository ] [-Credential ] [-IncludeDependencies] [-WhatIf] [-Confirm] [] -``` - -### DscResourceNameParameterSet -``` PowerShell -[[-DscResourceName] ] [-ModuleName ] [-Version ] [-Prerelease] [-Tag ] -[-Repository ] [-Credential ] [-IncludeDependencies] [-WhatIf] [-Confirm] [] -``` -### TagParameterSet -``` PowerShell -[[-Name ][-Tag ] [-Prerelease] -[-Repository ] [-Credential ] [-IncludeDependencies] [-WhatIf] [-Confirm] [] -``` - -### TypeParameterSet -``` PowerShell -[[Name ] [-Prerelease] [-Type ] -[-Repository ] [-Credential ] [-IncludeDependencies] [-WhatIf] [-Confirm] [] -``` - -## Parameters - -### -Name - -Name of a resource or resources to find. -Accepts wild card character '*'. - -```yml -Type: string[] -Parameter Sets: ResourceNameParameterSet -``` - -### -Type - -Specifies one or more resource types to find. -Resource types supported are: Module, Script, Command, DscResource. - -```yml -Type: Microsoft.PowerShell.PowerShellGet.UtilClasses.ResourceType[] -Parameter Sets: ResourceNameParameterSet -AllowedValues: 'Module','Script','DscResource','Command' -``` - -### -Version - -Specifies the version of the resource to be returned. - -```yml -Type: string -Parameter Sets: (All) -``` - -### -Prerelease - -When specified, includes prerelease versions in search results returned. - -```yml -Type: SwitchParameter -Parameter Sets: (All) -``` - -### -Tag - -Filters search results for resources that include one or more of the specified tags. - -```yml -Type: string[] -Parameter Sets: (All) -``` - -### -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. - -```yml -Type: string[] -Parameter Sets: (All) -``` - -### -Credential - -Optional credentials to be used when accessing a repository. - -```yml -Type: PSCredential -Parameter Sets: (All) -``` - -### -IncludeDependencies - -When specified, search will return all matched resources along with any resources the matched resources depends on. -Dependencies are deduplicated. - -```yml -Type: SwitchParameter -Parameter Sets: (All) -``` - -### -CommandName - -Specifies a list of command names that searched module packages will provide. -Wildcards are supported. -Not yet implemented. - -```yml -Type: string[] -Parameter Sets: CommandNameParameterSet -``` - -### -DscResourceName - -Specifies a list of dsc resource names that searched module packages will provide. -Wildcards are supported. -Not yet implemented. - -```yml -Type: string[] -Parameter Sets: DscResourceNameParameterSet -``` - -### -ModuleName - -Specifies a module resource package name type to search for. -Wildcards are supported. -Not yet implemented. - -```yml -Type: string -Parameter Sets: CommandNameParameterSet, DscResourceParameterSet -``` - -### Outputs - -```json -"PSResourceInfo" : { - "Author", - "CompanyName", - "Copyright", - "Dependencies", - "Description", - "IconUri", - "Includes", - "InstalledDate", - "InstalledLocation", - "IsPrerelease", - "LicenseUri", - "Name", - "PackageManagementProvider", - "PowerShellGetFormatVersion", - "PrereleaseLabel", - "ProjectUri", - "PublishedDate", - "ReleaseNotes", - "Repository", - "RepositorySourceLocation", - "Tags", - "Type", - "UpdatedDate", - "Version" -} -``` - -## Notes - -Search strategy will depend on what NuGet APIs support on the server. -PowerShell has its own wildcard behavior that may not be compatible with the NuGet APIs. -The V2 APIs do provide property filtering and some limited wildcard support. -It is not yet clear if V2 or V3 APIs should be used. -Need benefit cost analysis. - -Search can be performed on remote or local (file based) repositories, depending on the repository Url. - -Does the `-Credential` parameter apply to all repositories being searched? -If so, can that result in an error for repositories that do not require credentials? -How are multiple repository searches that require different credentials handled? -Should searches with credential be limited to a single repository? - -Should search results be cached locally on the client machine? -If so, should the cache be per PowerShell session or file based? -At what point should the local cache be updated from the server? -Should there be a parameter switch that forces the search to go directly to the server and skip the local cache? -Should the cache be used if a specific repository is specified? -We should assume that a specific resource package version is identical over any repository from which it is retrieved. - -Should a search with no name or 'all' wildcard result in all repository items returned? -Should there be a default limit for number of items returned, and if so can it be bypassed? - -The V2 `Find-Command, Find-DscResource` will be combined into `Find-PSResource`. -The `Find-RoleCapability` cmdlet will be dropped for the first release of V3. - -## Tests - -Most search tests can be performed on a local repository. - -Some tests should be performed on remote repository (PSGallery) to verify remote operation, but can be limited. - -### -Name param - -- Single name search -- Wildcard search -- Multiple name search -- Cancel search -- Errors: Not found (single name, wildcard, multiple name) -- Errors: Repository: Invalid name, connection error, etc - -### -Type param - -- Validate correct resource type returned - -### -Version param - -- Validate correct resource version returned -- Validate wild card (if supported), correct version range returned -- Errors: Not found -- Errors: Invalid version string format - -### -Prerelease param - -- Validate prerelease version returned - -### -Tags param - -- Validate tag filtering on returned resources - -### -Repository param - -- All repository search -- Single repository search -- Multiple repository search -- Errors: Repository not found - -### -Credential param - -- Validate credential search -- Errors: Credential: Invalid - -### -IncludeDependencies param - -- Validate dependency inclusion in return results - -## Work Items - -### Create cmdlet and parameter sets - -Create cmdlet class, parameters, and functional stubs -1 day - -### Implement package search helpers - -Create helper functions that support all search functions -Use existing code as starting point -4 days - -### Investigate V3 API wildcard support - -Look into how V3 APIs can be used to reduce what is returned from the server -7 days - -### Implement package filtering functions - -Create helper functions to provide filtering of search results -3 days - -### Investigate and implement local cache - -Write mini-design document on local caching strategy -Implement local cache -10 days - -### Create test support - -Create any test repositories and mocks for tests -4 days - -### Write cmdlet tests - -Create all functional tests to validate cmdlet -5 days - -### Write support function tests - -Create all needed tests to validate caching and search helpers -5 days diff --git a/Docs/GetPSResource.md b/Docs/GetPSResource.md deleted file mode 100644 index fcaf0212f..000000000 --- a/Docs/GetPSResource.md +++ /dev/null @@ -1,148 +0,0 @@ -# Get-PSResource - -The `Get-PSResource` cmdlet combines the `Get-InstalledModule, Get-InstalledScript` cmdlets from V2. -It performs a search within module or script installation paths based on the `-Name` parameter argument. -It returns `PSRepositoryItemInfo` objects which describe each resource item found. -Other parameters allow the returned results to be filtered by version, prerelease version, and path. - -## Syntax - -### NameParameterSet (Default) -``` PowerShell -[[-Name] ] [-Version ] [-Type ] [-Prerelease] [-Path ] [-WhatIf] [-Confirm] [] -``` - - -## Parameters - -### -Name - -Name of a resource or resources to find. -Accepts wild card characters. - -```yml -Type: string[] -Parameter Sets: NameParameterSet -``` - -### -Version - -Specifies the version of the resource to be returned. - -```yml -Type: string -Parameter Sets: NameParameterSet -``` - -### -Type - -Specifies one or more resource types to find. -Two resource types are supported: Module and Script. - -```yml -Type: string[] -Parameter Sets: ResourceNameParameterSet -AllowedValues: 'Module','Script' -``` - -### -Prerelease - -When specified, includes prerelease versions in search. - -```yml -Type: SwitchParameter -Parameter Sets: NameParameterSet -``` - -### -Path - -Specifies the path to search in. - -```yml -Type: string -Parameter Sets: NameParameterSet -``` - - -### Outputs - -```json -"PSRepositoryItemInfo" : { - "Name", - "Version", - "Type", - "Description", - "Author", - "CompanyName", - "Copyright", - "PublishedDate", - "InstalledDate", - "UpdatedDate", - "LicenseUri", - "ProjectUri", - "IconUri", - "Tags", - "Includes", - "PowerShellGetFormatVersion", - "ReleaseNotes", - "Dependencies", - "RepositorySourceLocation", - "Repository", - "PackageManagementProvider", - "AdditionalMetadata" -} -``` - -## Notes - -Currently the `-Prerelease` parameter is not implemented. - -Add why - -## Tests - -Most search tests can be performed on a local file system. - -### -Name param - -- Single name search -- Wildcard search -- Multiple name search -- Cancel search -- Errors: Not found (single name, wildcard, multiple name) -- Errors: File path: Invalid name, cannot find, etc - -### -Version param - -- Validate correct resource version returned -- Validate wild card (if supported), correct version range returned -- Errors: Not found -- Errors: Invalid version string format - -### -Prerelease param - -- Validate prerelease version returned - -### -Path param - -- Single path search -- OneDrive path search -- Errors: Path not found - -## Work Items - -### Create cmdlet and parameter sets - -Create cmdlet class, parameters, and functional stubs -2 days - -### Create test support - -Create any test repositories and mocks for tests -4 days - -### Write cmdlet tests - -Create all functional tests to validate cmdlet -5 days - diff --git a/Docs/GetPSResourceRepository.md b/Docs/GetPSResourceRepository.md deleted file mode 100644 index f333058c9..000000000 --- a/Docs/GetPSResourceRepository.md +++ /dev/null @@ -1,78 +0,0 @@ -# Get-PSResourceRepository - -The `Get-PSResourceRepository` cmdlet replaces the `Get-PSRepository` cmdlet from V2. - -It 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 wil return the repository whose name matches the specified value. - -It returns `PSRepositoryInfo` objects which describe each resource item found. - -## Syntax - -### NameParameterSet (Default) -``` PowerShell -[[-Name] ] [-WhatIf] [-Confirm] [] -``` - -## Parameters - -### -Name - -Name of a registered repository to find. -Supports wild card characters. - -```yml -Type: string[] -Parameter Sets: NameParameterSet -``` - -### Outputs - -```json -"PSRepositoryInfo" : { - "Name", - "Url", - "Trusted", - "Priority" -} -``` - -## Notes - -Running the `Get-PSResourceRepository` cmdlet without a Name parameter specified will return all registered repositories. - -## Tests - -Tests added for terminating and non-terminating error handling. - -Tests able to get repositories with different allowed URL URI schemes. - -### -Name param - -- Single name search -- wilcard search and empty value (returns all) compatibility -- Multiple name search -- Errors: Repository not found (single name, multiple name) - -## Work Items - -### Create cmdlet and parameter sets - -Create cmdlet class, parameters, and functional stubs -1 day - -### Switch output to PSRepositoryInfo type - -Switch from returning Object object to PSRepositoryInfo object, and create that class -1-2 days - -### Create test support - -Create any test repositories and mocks for tests -1 day - -### Write cmdlet tests - -Create all functional tests to validate cmdlet -1 day diff --git a/Docs/InstallPSResource.md b/Docs/InstallPSResource.md deleted file mode 100644 index b9a946204..000000000 --- a/Docs/InstallPSResource.md +++ /dev/null @@ -1,263 +0,0 @@ -# Install-PSResource - -The `Install-PSResource` cmdlet combines the `Install-Module, Install-Script` cmdlets from V2. -It performs an installation from a package found on a repository (local or remote) based on the `-Name` parameter argument. -It does not return an object. -Other parameters allow the returned results to be further filtered. - -## Syntax - -### NameParameterSet (Default) -``` PowerShell -[[-Name] ] [-Version ] [-Prerelease] [-Repository ] -[-Credential ] [-Scope ] [-NoClobber] [-TrustRepository] -[-Reinstall] [-Quiet] [-AcceptLicense] [-WhatIf] [-Confirm] [] -``` -### InputObjectParameterSet -``` PowerShell -[[-InputObject] ] -``` -### RequiredResourceParameterSet -``` PowerShell -[[-RequiredResource] ] [-Quiet] [-WhatIf] [-Confirm] [] -``` -### RequiredResourceFileParameterSet -``` PowerShell -[[-RequiredResourceFile] ] [-Quiet] [-WhatIf] [-Confirm] [] -``` - -## Parameters - -### -Name - -Name of a resource or resources to be installed. -Accepts wild card characters. - -```yml -Type: string[] -Parameter Sets: NameParameterSet -``` - -### -Version - -Specifies the version or version range of the resource to be installed. - -```yml -Type: string -Parameter Sets: NameParameterSet -``` - -### -Prerelease - -When specified, allows installation of prerelease versions. - -```yml -Type: SwitchParameter -Parameter Sets: NameParameterSet, RequiredResourceFileParameterSet -``` - -### -Repository - -Specifies one or more repository names to search. -If not specified, search will the highest priority repository. - -```yml -Type: string[] -Parameter Sets: NameParameterSet, RequiredResourceFileParameterSet -``` - -### -Credential - -Optional credentials to be used when accessing a private repository. - -```yml -Type: PSCredential -Parameter Sets: NameParameterSet, RequiredResourceFileParameterSet -``` - -### -Scope - -When specified, will install to either CurrentUser or AllUsers scope. - -```yml -Type: String -Parameter Sets: NameParameterSet, RequiredResourceFileParameterSet -AllowedValues: 'CurrentUser','AllUsers' -``` - -### -NoClobber - -Prevents installing modules that have the same cmdlets as a differently named module already installed. - -```yml -Type: string[] -Parameter Sets: NameParameterSet, RequiredResourceFileParameterSet -``` - -### -TrustRepository - -If specified, suppresses prompt for untrusted repositories. - -```yml -Type: SwitchParameter -Parameter Sets: NameParameterSet, RequiredResourceFileParameterSet -``` - -### -Reinstall - -If specified, overwrites a previously installed resource with the same name and version. - -```yml -Type: string -Parameter Sets: NameParameterSet, RequiredResourceFileParameterSet -``` - -### -Quiet - -If specified, suppresses progress information. - -```yml -Type: string -Parameter Sets: NameParameterSet, RequiredResourceFileParameterSet -``` - -### -AcceptLicense - -If specified, modules that require a license agreement will be automatically accepted during installation. - -```yml -Type: string -Parameter Sets: NameParameterSet, RequiredResourceFileParameterSet -``` - -### -RequiredResourceFile - -Specifies a file - -```yml -Type: string -Parameter Sets: RequiredResourceFileParameterSet -``` - -### -RequiredResourceJSON - -Installs the resources specified in the json configuration. - -```yml -Type: string or hashtable -Parameter Sets: RequiredResourceParameterSet -``` - -### -InputObject - -Installs the resources passed in via pipeline. - -```yml -Type: ? -Parameter Sets: InputObjectParameterSet -``` - -### Outputs - -No output. - -## Notes - - -### -Name param - -- Single name search -- Wildcard search -- Multiple name search -- Cancel search -- Errors: Not found (single name, wildcard, multiple name) -- Errors: Repository: Invalid name, connection error, etc - -### -Version param - -- Validate correct resource version installed -- Validate wild card (if supported), correct version range installed -- Errors: Not found -- Errors: Invalid version string format - -### -Prerelease param - -- Validate prerelease version installed - -### -Repository param - -- All repository search -- Single repository search -- Multiple repository search -- Errors: Repository not found - -### -Credential param - -- Validate credential search -- Errors: Credential: Invalid - -### -Scope param - -- Validate installation to correct scope (both current and all users) - -### -NoClobber param - -- Validate proper warning message if clobbering will happen - -### -TrustRepository param - -- Validate that user is not prompted and has access to repository - -### -Reinstall param - -- Validate proper installation when the module version is already installed -- Validate proper installation if resource is not installed - -### -Quiet param - -- Validate that progress bar is supressed - -### -AcceptLicense param - -- Validate that there is no prompt for modules that require license agreement - -### -RequiredResourceFile param - -- - -### -RequiredResourceJSON param - -- Validate that installation works with hashtable input -- Validate that installation works with string input -- Validate that all parameters work in string or hashtable -- Error: incorrect formatting -- Error: incorrect object type - -### -InputObject param - -- Validate that object passed in is able to install - - -## Work Items - -### Create cmdlet and parameter sets - -Create cmdlet class, parameters, and functional stubs -1 day - -### Implement package install helpers - -Create helper functions that support all search functions -Use existing code as starting point -4 days - -### Create test support - -Create any test repositories and mocks for tests -4 days - -### Write cmdlet tests - -Create all functional tests to validate cmdlet -5 days - diff --git a/Docs/PublishPSResource.md b/Docs/PublishPSResource.md deleted file mode 100644 index e1a38b8da..000000000 --- a/Docs/PublishPSResource.md +++ /dev/null @@ -1,310 +0,0 @@ -# Publish-PSResource - -The `Publish-PSResource` cmdlet combines the `Publish-Module` and `Publish-Script` cmdlets from V2. - -It publishes a specified resource from the local computer to an online Nuget-based gallery by using an API key, stored as part of a user's profile in the gallery or to a local repository. You can specify the resource to publish either by the resource's name, or by the path to the folder containing the module or script resource. - -## Syntax - -### PathParameterSet -``` PowerShell -[[-APIKey] ] [-Repository ] [-DestinationPath ] [-Path] ] [-Credential ] [-SkipDependenciesCheck] [-ReleaseNotes ] [-Tags ] [-LicenseUrl ] [-IconUrl ] [-ProjectUrl ] [-NuspecPath ] [-Proxy ][-ProxyCredential ] [-WhatIf] [-Confirm] [] -``` - -### PathLiteralParameterSet -``` PowerShell -[[-APIKey] ] [-Repository ] [-DestinationPath ] [-LiteralPath] ] [-Credential ] [-SkipDependenciesCheck] [-ReleaseNotes ] [-Tags ] [-LicenseUrl ] [-IconUrl ] [-ProjectUrl ] [-NuspecPath ] [-Proxy ][-ProxyCredential ] [-WhatIf] [-Confirm] [] -``` - -## Parameters - -### -APIKey - -Specifies the API key that you want to use to publish a resource to the online gallery. -Not mandatory. - -```yml -Type: string -Parameter Sets: PathParameterSet, PathLiteralSet -``` - -### -Repository - -Specifies the repository to publish to. - -```yml -Type: string -Parameter Sets: PathParameterSet, PathLiteralSet -``` - -### -DestinationPath - -Specifies the location to be used to publish a nupkg locally. - -```yml -Type: string -Parameter Sets: (All) -``` - -### -Path - -When specified, includes prerelease versions in search. - -```yml -Type: string -Parameter Sets: PathParameterSet -``` - -### -LiteralPath - -Specifies a path to one or more locations. Unlike the Path parameter, the value of the LiteralPath parameter is used exactly as entered. No characters are interpreted as wildcards. If the path includes escape characters, enclose them in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences. - -```yml -Type: string -Parameter Sets: PathLiteralParameterSet -``` - -### -Credential - -Specifies a user account that has rights to a specific repository (used for finding dependencies). - -```yml -Type: PSCredential -Parameter Sets: PathParameterSet, PathLiteralSet -``` - -### -SkipDependenciesCheck - -Bypasses the default check that all dependencies are present. - -```yml -Type: SwitchParameter -Parameter Sets: PathParameterSet, PathLiteralSet -``` - -### -ReleaseNotes - -Updates nuspec: specifies a string containing release notes or comments that you want to be available to users of this version of the resource. - -```yml -Type: string -Parameter Sets: PathParameterSet, PathLiteralSet -``` - -### -Tags - -Updates nuspec: adds one or more tags to the resource that you are publishing. This applies only to the nuspec. - -```yml -Type: string[] -Parameter Sets: PathParameterSet, PathLiteralSet -``` - -### -LicenseUrl - -Updates nuspec: specifies the URL of licensing terms for the resource you want to publish. - -```yml -Type: string -Parameter Sets: PathParameterSet, PathLiteralSet -``` - -### -IconUrl - -Updates nuspec: specifies the URL of an icon for the resource. - -```yml -Type: string -Parameter Sets: PathParameterSet, PathLiteralSet -``` - -### -ProjectUrl - -Updates nuspec: specifies the URL of a webpage about this project. - -```yml -Type: string -Parameter Sets: PathParameterSet, PathLiteralSet -``` - -### -Exclude - -Excludes files from a nuspec - -```yml -Type: string[] -Parameter Sets: ModuleNameParameterSet -``` - -### -NuspecPath - -Specifies a nuspec file by path rather than relying on this module to produce one. - -```yml -Type: string -Parameter Sets: PathParameterSet, PathLiteralSet -``` - -### -Proxy - -Specifies a proxy server for the request, rather than a direct connection to the internet resource. - -```yml -Type: Uri -Parameter Sets: PathParameterSet, PathLiteralSet -``` - -### -ProxyCredential - -Specifies a user account that has permission to use the proxy server that is specified by the Proxy parameter. - -```yml -Type: PSCredential -Parameter Sets: PathParameterSet, PathLiteralSet -``` - -### -PassThru - -When specified, displays the succcessfully published resource and its information. - -```yml -Type: PSCredential -Parameter Sets: PathParameterSet, PathLiteralSet -``` - -### Outputs - -if `-PassThru` is not specified output is none - -if `-PassThru` is specified output is: - -```json -"PSRepositoryItemInfo" : { - "Name", - "Version", - "Type", - "Description", - "Author", - "CompanyName", - "Copyright", - "PublishedDate", - "InstalledDate", - "UpdatedDate", - "LicenseUri", - "ProjectUri", - "IconUri", - "Tags", - "Includes", - "PowerShellGetFormatVersion", - "ReleaseNotes", - "Dependencies", - "RepositorySourceLocation", - "Repository", - "PackageManagementProvider", - "AdditionalMetadata" -} -``` - -## Notes - -## Tests - -Some tests should be performed to publish a resource of type Module, and othersfor resource of type Script. - -Tests should have varying levels of required and optional nuspec data to test parsing helper methods. - -### -APIKey param - -- Validate not null or empty if paramater arguemnt provided -- Errors: APIKey not valid or incorrect format - -### -Repository param - --Validate not null or empty if paramater arguemnt provided --Errors: Repository referenced is not registered or found. - -### -DestinationPath param - --Validate not null or empty if paramater arguemnt provided --Errors: DestinationPath does not exist. - -### -Path param - --Validate not null or empty if paramater arguemnt provided --Errors: validate not null or empty if provided, path does not exist - -### -LiteralPath param - --Validate not null or empty if paramater arguemnt provided --Errors: Literal path does not exist. - -### -Credential param - --Validate not null or empty if paramater arguemnt provided - -### -ReleaseNotes param - --Validate not null or empty if paramater arguemnt provided - -### -Tags param - --Validate not null or empty if paramater arguemnt provided - -### -LicenseUrl param - --Validate not null or empty if paramater arguemnt provided - -### -IconUrl param - --Validate not null or empty if paramater arguemnt provided - -### -ProjectUrl param - --Validate not null or empty if paramater arguemnt provided - -### -Exclude param - --Validate not null or empty if paramater arguemnt provided --Errors: files specified do not exist - -### -NuspecPath param - --Validate not null or empty if paramater arguemnt provided --Errors: file does not exist, not of valid format or extension. - -### -Proxy param - --Validate not null or empty if paramater arguemnt provided - -## Work Items - -### Create cmdlet and parameter sets - -Create cmdlet class, parameters, and functional stubs -1 day - -### Implement publish function helper methods - -Create helper functions that support all search functions -Use existing code as starting point -1-2 days - -### Implement publish function method - -Create main publish function method, use existing code as starting point -1 day - -### Create test support - -Create any test repositories and mocks for tests -1 day - -### Write cmdlet tests - -Create all functional tests to validate cmdlet -1-2 days - -### Write support function tests - -Create all needed tests to validate publish helpers -1-2 days diff --git a/Docs/RegisterPSResourceRepository.md b/Docs/RegisterPSResourceRepository.md deleted file mode 100644 index f5fb2e1c2..000000000 --- a/Docs/RegisterPSResourceRepository.md +++ /dev/null @@ -1,176 +0,0 @@ -# Register-PSResourceRepository - -The `Register-PSResourceRepository` cmdlet replaces the `Register-PSRepository` from V2. - -It registers a repository for PowerShell resources. The repository is registered to the user's machine. - -The Register-PSResourceRepository cmdlet determines which repository will be the default when searching for PowerShell modules. This is done by specifying the priority for a repository when registering it. So later when other cmdlets are used to search for/install a resource, it will look through all registered repositories (in order of highest ranking priority and then by alphabetical order) until it finds the first match. The aforementioned compatible cmdlets that use this default repository rankings include: Find-PSResource, Install-PSResource, and Publish-PSResource cmdlets. - -## Syntax - -### NameParameterSet (Default) -``` PowerShell -[[-Name] ] [-URL ] [-Priority ] [-Trusted] [-WhatIf] [-Confirm] [] -``` - -### PSGalleryParameterSet -``` PowerShell -[[-Priority ] [-Trusted] [-PSGallery] [-WhatIf] [-Confirm] [] -``` - -### RepositoriesParameterSet -``` PowerShell -[[-Repositories] >] [-WhatIf] [-Confirm] [] -``` - -## Parameters - -### -Name - -Name for the repository to be registered. - -```yml -Type: string -Parameter Sets: NameParameterSet -``` - -### -URL - -Specifies the URL location of the repository to be registered. - -```yml -Type: Uri -Parameter Sets: NameParameterSet -``` - -### -PSGallery - -When specified, registers PSGallery repository. - -```yml -Type: SwitchParameter -Parameter Sets: PSGalleryParameterSet -``` - -### -Repositories - -Specifies a hashtable of repositories and is used to register multiple repositories at once. - -```yml -Type: List -Parameter Sets: RepositoriesParameterSet -``` - -### -Trusted - -Specifies whether the repository should be trusted. - -```yml -Type: SwitchParameter -Parameter Sets: NameParameterSet, PSGalleryParameterSet -``` - -### -Proxy - -Specifies a proxy server for the request, rather than a direct connection to the internet resource. - -```yml -Type: Uri -Parameter Sets: NameParameterSet, PSGalleryNamesSet, RepositoriesParameterSet -``` - -### -ProxyCredential - -Specifies a user account that has permission to use the proxy server that is specified by the Proxy parameter. - -```yml -Type: PSCredential -Parameter Sets: NameParameterSet, PSGalleryNamesSet, RepositoriesParameterSet -``` - -### -Priority - -Specifies the priority ranking of the repository, such that repositories with higher ranking priority are searched before a lower ranking priority one, when searching for a repository item across multiple registered repositories. Valid priority values range from 0 to 50, such that a lower numeric value (i.e 10) corresponds to a higher priority ranking than a higher numeric value (i.e 40). Has default value of 50. or example, if a item was being searched for across two repositories with the aforementioned ranking than the repository with priority 10 would be searched first. - -```yml -Type: int -Parameter Sets: NameParameterSet, PSGalleryParameterSet -``` - -### -PassThru - -When specified, displays the succcessfully registered repository and its information. - -```yml -Type: SwitchParameter -Parameter Sets: NameParameterSet, PSGalleryParameterSet, RepositoriesParameterSet -``` - -### Outputs - -if `-PassThru` not specified, output is none - -if `-PassThru` is specified, output is: - -```json -"PSRepositoryInfo" : { - "Name", - "Url", - "Trusted", - "Priority" -} -``` - -## Notes - -In this V3 cmdlet, repository uniqueness is dictated by the `-Name` parameter. This is unlike in the V2 cmdlet `Register-PSRepository`, whre the `-SourceLocation` parameter (equivalent of `URL` parameter here) dictated uniqueness, so a repository could not be registered if one with the same `-SourceLocation` value had already been registered. - -## Tests - -Tests able to register repositories with different allowed URL URI schemes. - -### -Name param - -- Single name registering -- Errors: Invalid name (i.e with wildcard character) -- Errors: Name is null -- Errors: Name is just whitespace -- Errors: Name is not unique (another repository is already registered with same name) -- Errors: Name is "PSGallery" when registering with NameParameterSet - -### -URL param - -- Errors: URL is null when NameParameterSet is used -- Errors: URL is of invalid URI scheme (i.e not HTTPS, HTTP, FTP, File Based URI scheme) - -### -Repositories param - -- Errors: Expected Hashtable keys not found -- Errors: PSGallery provided with Name or URI key -- Errors: Name key value is "PSGallery" - -### -Priority param - -- Validate priority value supplied is in range of 0-50 - -## Work Items - -### Create cmdlet and parameter sets - -Create cmdlet class, parameters, and functional stubs -1 day - -### Implement repository registering function - -Write ProcessRecord() function, perhaps split time/task by ParamaterSet and corresponding functionality -1-2 days - -### Create test support - -Create any test repositories and mocks for tests -1 day - -### Write cmdlet tests - -Create all functional tests to validate cmdlet -1 day diff --git a/Docs/SavePSResource.md b/Docs/SavePSResource.md deleted file mode 100644 index 741e94002..000000000 --- a/Docs/SavePSResource.md +++ /dev/null @@ -1,205 +0,0 @@ -# Save-PSResource - -The `Save-PSResource` cmdlet combines the `Save-Module, Save-Script` cmdlets from V2. -It saves from a package found on a repository (local or remote) based on the `-Name` parameter argument. -It does not return an object. -Other parameters allow the returned results to be further filtered. - -## Syntax - -### NameParameterSet (Default) -``` PowerShell -[[-Name] ] [-Version ] [-Prerelease] [-Repository ] -[-Path string] [-Credential ] [-AsNupkg] [-IncludeXML] [-TrustRepository] [-WhatIf] [-Confirm] [] -``` - -### InputObjectParameterSet -``` PowerShell -[[-InputObject] ] [-WhatIf] [-Confirm] [] -``` - -## Parameters - -### -Name - -Name of a resource or resources to save from a repository. -A comma-separated list of module names is accepted. The resource name must match the resource name in the repository. - -```yml -Type: string[] -Parameter Sets: NameParameterSet -``` - -### -Version - -Specifies the version or version range of the resource to be saved. - -```yml -Type: string -Parameter Sets: NameParameterSet -``` - -### -Prerelease - -When specified, allow saving prerelease versions. - -```yml -Type: SwitchParameter -Parameter Sets: NameParameterSet -``` - -### -Repository - -Specifies one or more repository names to search. -If not specified, search will only search the highest priority repository. - -```yml -Type: string[] -Parameter Sets: NameParameterSet -``` - -### -Credential - -Optional credentials to be used when accessing a private repository. - -```yml -Type: PSCredential -Parameter Sets: NameParameterSet -``` - -### -AsNupkg - -When specified, saves the resource as a .nupkg. - -```yml -Type: SwitchParameter -Parameter Sets: NameParameterSet -``` - -### -IncludeXML - -Saves the metadata XML file with the resource. - -```yml -Type: string[] -Parameter Sets: NameParameterSet -``` - -### -Path - -Specifies the destination where the resource is to be saved. - -```yml -Type: string -Parameter Sets: NameParameterSet -``` - -### -TrustRepository - -When specified, suppresses being prompted for untrusted sources. - -```yml -Type: SwitchParameter -Parameter Sets: NameParameterSet -``` - -### -InputObject - -Used to pass in an object via pipeline to save. - -```yml -Type: object[] -Parameter Sets: InputObjectParameterSet -``` - -### Outputs - -No output. - -## Notes - -Should -TrustRepository parameter be removed? Ie, should repositories be trusted by default? -Now that we have repository priorities, one could set an untrusted repository to a lower priority. - -How often is a repository intentionally set as 'untrusted'? - - -## Tests - -Most search tests can be performed on a local repository. - -### -Name param - -- Single name search -- Wildcard search -- Multiple name search -- Cancel search -- Errors: Not found (single name, wildcard, multiple name) -- Errors: Repository: Invalid name, connection error, etc - -### -Version param - -- Validate correct resource version returned -- Validate wild card (if supported), correct version range returned -- Errors: Not found -- Errors: Invalid version string format - -### -Prerelease param - -- Validate prerelease version returned - -### -Repository param - -- All repository search -- Single repository search -- Multiple repository search -- Errors: Repository not found - -### -Credential param - -- Validate credential search -- Errors: Credential: Invalid - -### -AsNupkg param - -- Validate that package gets saved as .nupkg -- Errors: package is unable to save - -### -IncludeXML param - -- Validate that package gets saved with xml -- Errors: unable to create XML, unable to save XML - -### -Path param - -- Validate that package saves in the correct path -- Errors: unable to access path (such as OneDrive or paths with spaces) - -### -TrustRepository - -- Validate that user is not prompted and has access to repository - - - -## Work Items - -### Create cmdlet and parameter sets - -Create cmdlet class, parameters, and functional stubs -1 day - -### Implement uninstall helpers - -Create helper functions that support all search functions -Use existing code as starting point -2 days - -### Create test support - -Create any test repositories and mocks for tests -4 days - -### Write cmdlet tests - -Create all functional tests to validate cmdlet -5 days diff --git a/Docs/SetPSResourceRepository.md b/Docs/SetPSResourceRepository.md deleted file mode 100644 index d363f2a04..000000000 --- a/Docs/SetPSResourceRepository.md +++ /dev/null @@ -1,174 +0,0 @@ -# Set-PSResourceRepository - -The `Set-PSResourceRepository` cmdlet replaces the `Set-PSRepository` cmdlet from V2. - -It sets the values for an already registered module repository. Specifically, it sets values for -either the `-URL`, `-Trusted` and `-Priority` parameter arguments by additionally providing the `-Name` parameter argument. - -The settings are persistent on the machine and apply to all versions of PowerShell installed for that user. - -The `-URL` for the PSGallery repository, which is pre-defined for this repository which is registered by default on each user's PowerShell instance, cannot be set via this cmdlet and will generate an exception. - -## Syntax - -### NameParameterSet (Default) -``` PowerShell -[[-Name] ] [-URL ] [-Credential ] [-Trusted] [-WhatIf] [-Confirm] [] -``` - -### RepositoriesParameterSet -``` PowerShell -[[-Repositories] ] [-WhatIf] [-Confirm] [] -``` - -## Parameters - -### -Name - -Specifies name of the registered repository to be set. -Does not accept wildcard characters. - -```yml -Type: string -Parameter Sets: NameParameterSet -``` - -### -URL - -Specifies the location of the repository to be set. -Types of Uri's supported: HTTPS, HTTP, File base, FTP scheme - -```yml -Type: Uri -Parameter Sets: NameParameterSet -``` - -### -Credential - -Specifies a user account that has rights to find a resource from a specific repository. - -```yml -Type: PSCredential -Parameter Sets: NameParameterSet -``` - -### -Repositories - -Specifies an array of hashtables containing information on repositories and is used to register multiple repositories at once. - -```yml -Type: Hashtable[] -Parameter Sets: RepositoriesParameterSet -``` - -### -Trusted - -When specified, repository will be set to trusted. - -```yml -Type: SwitchParameter -Parameter Sets: NameParameterSet -``` - -### -Proxy - -Specifies a proxy server for the request, rather than a direct connection to the internet resource. - -```yml -Type: Uri -Parameter Sets: NameParameterSet, RepositoriesParameterSet -``` - -### -ProxyCredential - -Specifies a user account that has permission to use the proxy server that is specified by the Proxy parameter. - -```yml -Type: PSCredential -Parameter Sets: NameParameterSet, RepositoriesParameterSet -``` - -### -Priority - -Specifies the priority ranking of the repository, such that repositories with higher ranking priority are searched before a lower ranking priority one, when searching for a repository item across multiple registered repositories. -Valid priority values range from 0 to 50, such that a lower numeric value (i.e 10) corresponds to a higher priority ranking than a higher numeric value (i.e 40). -For example, if a item was being searched for across two repositories with the aforementioned ranking than the repository with priority 10 would be searched first. - -```yml -Type: int -Parameter Sets: NameParameterSet, RepositoriesParameterSet -``` - -### -PassThru - -When specified, displays the succcessfully set repository and its information - -```yml -Type: SwitchParameter -Parameter Sets: NameParameterSet, RepositoriesParameterSet -``` - -### Outputs - -if `-PassThru` not specified output is none - -if `-PassThru` is specified output is: - -```json -"PSRepositoryInfo" : { - "Name", - "Url", - "Trusted", - "Priority" -} -``` - -## Notes - -## Tests - -Tests added will need to set repositories to URLs with different allowed URI schemes. - -Test to verify Set-PSResourceRepository with PSGallery `-Name` and `-URL` value is not allowed, and generates error with expected error message. - -### -Name param - -- Single name search -- Errors: Not found (single name) -- Errors: Invalid name (i.e with wildcard character) -- Errors: Repository: Repository with name not found, etc - -### -URL param - -- Errors: if URL with unsupported type Uri scheme used, or if correct scheme but value is for path/location that doesn't exist -- Errors: if URL to be changed is used in conjuction with `-Name` parameter argument with value of PSGallery - -### -Repositories param - -- Errors: Expected Hashtable keys not found - -### -Priority param - -- Validate priority value supplied is in range of 0-50 - -## Work Items - -### Create cmdlet and parameter sets - -Create cmdlet class, parameters, and functional stubs -1 day - -### Implement repository update function - -Create and implement repository update function -1 day - -### Create test support - -Create any test repositories and mocks for tests -1 day - -### Write cmdlet tests - -Create all functional tests to validate cmdlet -1 day diff --git a/Docs/UninstallPSResource.md b/Docs/UninstallPSResource.md deleted file mode 100644 index ed447b88e..000000000 --- a/Docs/UninstallPSResource.md +++ /dev/null @@ -1,101 +0,0 @@ -# Uninstall-PSResource - -The `Uninstall-PSResource` cmdlet combines the `Uninstall-Module, Uninstall-Script` cmdlets from V2. -It uninstalls a package found in a module or script installation path based on the `-Name` parameter argument. -It does not return an object. -Other parameters allow the returned results to be further filtered. - -## Syntax - -### NameParameterSet (Default) -``` PowerShell -[[-Name] ] [-Version ] [-PrereleaseOnly] [-Tags ] -[-WhatIf] [-Confirm] [] -``` - -## Parameters - -### -Name - -Name of a resource or resources that has been installed. -Accepts wild card characters. - -```yml -Type: string[] -Parameter Sets: NameParameterSet -``` - -### -Version - -Specifies the version of the resource to be uninstalled. - -```yml -Type: string -Parameter Sets: NameParameterSet -``` - -### -PrereleaseOnly - -When specified, allows ONLY prerelease versions to be uninstalled. - -```yml -Type: SwitchParameter -Parameter Sets: NameParameterSet -``` - -### Outputs - -No output. - - -## Notes - -Should a -PassThru parameter be added? - -## Tests - -Most search tests can be performed on a local repository. - -### -Name param - -- Single name search -- Wildcard search -- Multiple name search -- Cancel search -- Errors: Not found (single name, wildcard, multiple name) -- Errors: Path errors (OneDrive access, etc) - -### -Version param - -- Validate correct resource version returned -- Validate wild card (if supported), correct version range returned -- Errors: Not found -- Errors: Invalid version string format - -### -Prerelease param - -- Validate prerelease version returned - - -## Work Items - -### Create cmdlet and parameter sets - -Create cmdlet class, parameters, and functional stubs -1 day - -### Implement uninstall helper - -Create helper functions that support all search functions -Use existing code as starting point -2 days - -### Create test support - -Create any test repositories and mocks for tests -4 days - -### Write cmdlet tests - -Create all functional tests to validate cmdlet -5 days diff --git a/Docs/UnregisterPSResourceRepository.md b/Docs/UnregisterPSResourceRepository.md deleted file mode 100644 index b7ef83ea0..000000000 --- a/Docs/UnregisterPSResourceRepository.md +++ /dev/null @@ -1,69 +0,0 @@ -# Unregister-PSResourceRepository - -The `Unregister-PSResourceRepository` cmdlet replaces the `Unregister-PSRepository` cmdlet from V2. - -It unregisters a repository that's found to be registered on the machine. - -## Syntax - -### NameParameterSet (Default) -``` PowerShell -[[-Name] ] [-WhatIf] [-Confirm] [] -``` - -## Parameters - -### -Name - -Specifies name(s) of the repositories to unregister. -Does not accept wild card characters. - -```yml -Type: string[] -Parameter Sets: NameParameterSet -``` - -### Outputs - -none - -## Notes - -`-Name` parameter doesn't support wildcard characters. - -## Tests - -Tests able to unregister repositories with different allowed URL URI schemas. - -Tests added for terminating and non-terminating error handling. - -Tests to unregister multiple repositories provided to `-Name`. - -### -Name param - -- Single name unregister -- Multiple name unregister -- Errors: Not found (single name,multiple name -- Errors: Name contains wildcard which isn't supported - -## Work Items - -### Create cmdlet and parameter sets - -Create cmdlet class, parameters, and functional stubs -1 day - -### Implement unregister function - -Create unregister function -1 day - -### Create test support - -Create any test repositories and mocks for tests -1 day - -### Write cmdlet tests - -Create all functional tests to validate cmdlet -1 day diff --git a/Docs/UpdatePSResource.md b/Docs/UpdatePSResource.md deleted file mode 100644 index dceff9cd7..000000000 --- a/Docs/UpdatePSResource.md +++ /dev/null @@ -1,217 +0,0 @@ -# Update-PSResource - -The `Update-PSResource` cmdlet combines the `Update-Module, Update-Script` cmdlets from V2. -It performs an upgraded installation of a package that is already installed based on the `-Name` parameter argument. -It does not return an object. -Other parameters allow the returned results to be further filtered. - -## Syntax - -### NameParameterSet (Default) -``` PowerShell -[[-Name] ] [-Version ] [-Prerelease] [-Scope ] -[-Repository ] [-TrustRepository] [-Credential ] [-Quiet] -[-AcceptLicense] [-NoClobber] [-WhatIf] [-Confirm] [] -``` - -## Parameters - -### -Name - -Name of a resource or resources to find. -Accepts wild card characters. - -```yml -Type: string[] -Parameter Sets: NameParameterSet -``` - -### -InputObject - -Specifies an object that is passed in via pipeline. -The object should be of type PSCustomObject. - -```yml -Type: PSCustomObject[] -Parameter Sets: InputObjectParameterSet -``` - -### -Version - -Specifies the version the resource is to be updated to. - -```yml -Type: string -Parameter Sets: NameParameterSet -``` - -### -Prerelease - -When specified, allows updating to a prerelease version. - -```yml -Type: SwitchParameter -Parameter Sets: NameParameterSet -``` - -### -Repository - -Specifies one or more repository names to update from. -If not specified, will search in the highest priority repository. - -```yml -Type: string[] -Parameter Sets: NameParameterSet -``` - -### -Scope - -Specifies the scope of the resource to update. - -```yml -Type: Microsoft.PowerShell.PowerShellGet.UtilClasses.ScopeType -Parameter Sets: NameParameterSet -AllowedValues: 'CurrentUser','AllUsers' -``` - -### -TrustRepository - -Suppresses being prompted for untrusted sources. - -```yml -Type: SwitchParameter -Parameter Sets: NameParameterSet -``` - -### -Credential - -Optional credentials to be used when accessing a repository. - -```yml -Type: PSCredential -Parameter Sets: NameParameterSet -``` - -### -Quiet - -Suppresses progress information. - -```yml -Type: SwitchParameter -Parameter Sets: (All) -``` - -### -AcceptLicense - -For modules that require a license, AcceptLicense automatically accepts the license agreement during update. - -```yml -Type: SwitchParameter -Parameter Sets: (All) -``` - -### Outputs - -No output. - -## Notes - -Should a -PassThru parameter be added? - -## Tests - -Most update tests can be performed on a local repository. - -Some tests should be performed on remote repository (PoshTestGallery) to verify remote operation, but can be limited. - -### -Name param - -- Single name search -- Wildcard search -- Multiple name search -- Cancel search -- Errors: Not found (single name, wildcard, multiple name) -- Errors: Repository: Invalid name, connection error, etc - -### -Version param - -- Validate the resource is updated to the correct version -- Validate wild card (if supported), that the resource is updated to the correct version range -- Errors: Not found -- Errors: Invalid version string format - -### -Prerelease param - -- Validate prerelease version returned - -### -Repository param - -- All repository search -- Single repository search -- Multiple repository search -- Errors: Repository not found - -### -Credential param - -- Validate credential search -- Errors: Credential: Invalid - -### -Scope param - -- Validate only the resource from the proper scope gets updated - -### -TrustRepository param - -- Validate that prompt is suppresed - -### -Quiet param - -- Validate that progress information is suppressed - -### -AcceptLicense - -- Validate that modules which require license agreements are approved without a prompt - -## Work Items - -### Create cmdlet and parameter sets - -Create cmdlet class, parameters, and functional stubs -1 day - -### Implement package search helpers - -Create helper functions that support all search functions -Use existing code as starting point -4 days - -### Investigate V3 API wildcard support - -Look into how V3 APIs can be used to reduce what is returned from the server -7 days - -### Implement package filtering functions - -Create helper functions to provide filtering of search results -3 days - -### Investigate and implement local cache - -Write mini-design document on local caching strategy -Implement local cache -10 days - -### Create test support - -Create any test repositories and mocks for tests -4 days - -### Write cmdlet tests - -Create all functional tests to validate cmdlet -5 days - -### Write support function tests - -Create all needed tests to validate caching and search helpers -5 days diff --git a/help/Install-PSResource.md b/help/Install-PSResource.md index ddecc1257..6be279d98 100644 --- a/help/Install-PSResource.md +++ b/help/Install-PSResource.md @@ -16,7 +16,13 @@ Installs resources (modules and scripts) from a registered repository onto the m ``` Install-PSResource [-Name] [-Version ] [-Prerelease] [-Repository ] [-Credential ] [-Scope ] [-TrustRepository] - [-Reinstall] [-Quiet] [-AcceptLicense] [-WhatIf] [-Confirm] [] + [-Reinstall] [-Quiet] [-AcceptLicense] [-NoClobber] [-SkipDependencyCheck] [-PassThru] [-WhatIf] [-Confirm] [] +``` + +### InputObjectParameterSet +``` +Install-PSResource [-InputObject ] [-Credential ] [-Scope ] [-TrustRepository] + [-Reinstall] [-Quiet] [-AcceptLicense] [-NoClobber] [-SkipDependencyCheck] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -67,7 +73,7 @@ Aliases: Required: True Position: 0 Default value: None -Accept pipeline input: True (ByPropertyName) +Accept pipeline input: True Accept wildcard characters: False ``` @@ -131,13 +137,13 @@ Optional credentials to be used when accessing a repository. ```yaml Type: System.Management.Automation.PSCredential -Parameter Sets: NameParameterSet +Parameter Sets: (All) Aliases: Required: False Position: Named Default value: None -Accept pipeline input: True (ByPropertyName) +Accept pipeline input: False Accept wildcard characters: False ``` @@ -146,7 +152,7 @@ Specifies the scope under which a user has access. ```yaml Type: Microsoft.PowerShell.PowerShellGet.UtilClasses.ScopeType -Parameter Sets: NameParameterSet +Parameter Sets: (All) Aliases: Accepted values: CurrentUser, AllUsers @@ -162,7 +168,7 @@ Suppress prompts to trust repository. The prompt to trust repository only occurs ```yaml Type: System.Management.Automation.SwitchParameter -Parameter Sets: NameParameterSet +Parameter Sets: (All) Aliases: Required: False @@ -177,7 +183,7 @@ Writes over any previously installed resource version that already exists on the ```yaml Type: System.Management.Automation.SwitchParameter -Parameter Sets: NameParameterSet +Parameter Sets: (All) Aliases: Required: False @@ -192,7 +198,7 @@ Supresses installation progress bar. ```yaml Type: System.Management.Automation.SwitchParameter -Parameter Sets: NameParameterSet +Parameter Sets: (All) Aliases: Required: False @@ -207,7 +213,7 @@ Specifies that the resource should accept any request to accept license. This wi ```yaml Type: System.Management.Automation.SwitchParameter -Parameter Sets: NameParameterSet +Parameter Sets: (All) Aliases: Required: False @@ -217,12 +223,72 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -NoClobber +Prevents installing a package that contains cmdlets that already exist on the machine. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkipDependencyCheck +Skips the check for resource dependencies, so that only found resources are installed, and not any resources the found resource depends on. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Passes the resource installed to the console. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Used for pipeline input. + +```yaml +Type: Microsoft.PowerShell.PowerShellGet.UtilClasses.PSResourceInfo +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet. ```yaml Type: System.Management.Automation.SwitchParameter -Parameter Sets: NameParameterSet +Parameter Sets: (All) Aliases: cf Required: False @@ -238,7 +304,7 @@ The cmdlet is not run. ```yaml Type: System.Management.Automation.SwitchParameter -Parameter Sets: NameParameterSet +Parameter Sets: (All) Aliases: wi Required: False diff --git a/help/Save-PSResource.md b/help/Save-PSResource.md index 44d7f90a5..ae2ae400e 100644 --- a/help/Save-PSResource.md +++ b/help/Save-PSResource.md @@ -12,10 +12,16 @@ Saves resources (modules and scripts) from a registered repository onto the mach ## SYNTAX +### NameParameterSet ``` Save-PSResource [-Name] [-Version ] [-Prerelease] [-Repository ] - [-Credential ] [-AsNupkg] [-IncludeXML] [-Path ] [-WhatIf] [-Confirm] - [] + [-Credential ] [-AsNupkg] [-IncludeXML] [-Path ] [-TrustRepository] [-SkipDependencyCheck] [-PassThru] [-WhatIf] [-Confirm] [] +``` + +### InputObjectParameterSet +``` +Save-PSResource [-InputObject] [-Credential ] [-AsNupkg] + [-IncludeXML] [-Path ] [-TrustRepository] [-SkipDependencyCheck] [-PassThru] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -61,7 +67,7 @@ Aliases: Required: True Position: 0 Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) +Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` @@ -120,11 +126,26 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Credential +Optional credentials to be used when accessing a repository. + +```yaml +Type: System.Management.Automation.PSCredential +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -AsNupkg Saves the resource as a zipped .nupkg file. ```yaml Type: System.Management.Automation.SwitchParameter -Parameter Sets: NameParameterSet +Parameter Sets: (All) Aliases: Required: False @@ -139,7 +160,7 @@ Includes the PowerShellGet metadata XML (used to verify that PowerShellGet has i ```yaml Type: System.Management.Automation.SwitchParameter -Parameter Sets: NameParameterSet +Parameter Sets: (All) Aliases: Required: False @@ -154,7 +175,7 @@ Specifies the path to save the resource to. ```yaml Type: System.String -Parameter Sets: NameParameterSet +Parameter Sets: (All) Aliases: Required: False @@ -164,12 +185,72 @@ Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False ``` +### -TrustRepository +Suppress prompts to trust repository. The prompt to trust repository only occurs if the repository is not already set to a trusted level. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Passes the resource saved to the console. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkipDependencyCheck +Skips the check for resource dependencies, so that only found resources are saved, and not any resources the found resource depends on. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Used for pipeline input. + +```yaml +Type: Microsoft.PowerShell.PowerShellGet.UtilClasses.PSResourceInfo +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet. ```yaml Type: System.Management.Automation.SwitchParameter -Parameter Sets: NameParameterSet +Parameter Sets: (All) Aliases: cf Required: False @@ -185,7 +266,7 @@ The cmdlet is not run. ```yaml Type: System.Management.Automation.SwitchParameter -Parameter Sets: NameParameterSet +Parameter Sets: (All) Aliases: wi Required: False diff --git a/help/Uninstall-PSResource.md b/help/Uninstall-PSResource.md index 9dbd89a48..6bfdef5b7 100644 --- a/help/Uninstall-PSResource.md +++ b/help/Uninstall-PSResource.md @@ -12,8 +12,14 @@ Uninstalls a resource (module or script) that has been installed on the machine ## SYNTAX +### NameParameterSet ``` -Uninstall-PSResource [-Name] [-Version ] [-Force] [-WhatIf] [] +Uninstall-PSResource [-Name] [-Version ] [-SkipDependencyCheck] [-WhatIf] [] +``` + +### InputObjectParameterSet +``` +Uninstall-PSResource [-InputObject] [-SkipDependencyCheck] [-WhatIf] [] ``` ## DESCRIPTION @@ -54,13 +60,13 @@ Name of a resource or resources that has been installed. Accepts wild card chara ```yaml Type: System.String[] -Parameter Sets: (All) +Parameter Sets: NameParameterSet Aliases: Required: True Position: 0 Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) +Accept pipeline input: True (ByValue) Accept wildcard characters: True ``` @@ -79,12 +85,12 @@ Accept pipeline input: True Accept wildcard characters: False ``` -### -Force -Skips check to see if any modules have a dependency on the resource to be uninstalled. +### -SkipDependencyCheck +Skips check to see if other resources are dependent on the resource being uninstalled. ```yaml Type: System.Management.Automation.SwitchParameter -Parameter Sets: NameParameterSet +Parameter Sets: (All) Aliases: Required: False @@ -94,13 +100,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -InputObject +Used for pipeline input. + +```yaml +Type: Microsoft.PowerShell.PowerShellGet.UtilClasses.PSResourceInfo +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -WhatIf Shows what would happen if the cmdlet runs. The cmdlet is not run. ```yaml Type: System.Management.Automation.SwitchParameter -Parameter Sets: NameParameterSet +Parameter Sets: (All) Aliases: wi Required: False diff --git a/help/Unregister-PSResourceRepository.md b/help/Unregister-PSResourceRepository.md index 95f69b31f..764a5eb28 100644 --- a/help/Unregister-PSResourceRepository.md +++ b/help/Unregister-PSResourceRepository.md @@ -12,8 +12,9 @@ Un-registers a repository from the repository store. ## SYNTAX +### NameParameterSet ``` -Unregister-PSResourceRepository [-Name] [-WhatIf] [-Confirm] [] +Unregister-PSResourceRepository [-Name] [-PassThru][-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -68,6 +69,21 @@ Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False ``` +### -PassThru +Passes the resource installed to the console. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet. diff --git a/help/Update-PSResource.md b/help/Update-PSResource.md index 77723f3b4..167a60673 100644 --- a/help/Update-PSResource.md +++ b/help/Update-PSResource.md @@ -15,7 +15,7 @@ Updates a package already installed on the user's machine. ### NameParameterSet (Default) ``` Update-PSResource [-Name] [-Version ] [-Prerelease] [-Repository ] - [-Scope ] [-TrustRepository] [-Credential ] [-Quiet] [-AcceptLicense] [-WhatIf] [-Confirm] [] + [-Scope ] [-TrustRepository] [-Credential ] [-Quiet] [-AcceptLicense] [-Force] [-PassThru] [-SkipDependencyCheck] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -192,6 +192,51 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Force +When specified, bypasses checks for TrustRepository and AcceptLicense and updates the package. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Passes the resource updated to the console. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkipdependencyCheck +Skips the check for resource dependencies, so that only found resources are updated, and not any resources the found resource depends on. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet. diff --git a/src/code/InstallPSResource.cs b/src/code/InstallPSResource.cs index f2fc2e8ca..75ea69220 100644 --- a/src/code/InstallPSResource.cs +++ b/src/code/InstallPSResource.cs @@ -53,49 +53,43 @@ class InstallPSResource : PSCmdlet /// /// Specifies a user account that has rights to find a resource from a specific repository. /// - [Parameter(ParameterSetName = NameParameterSet)] - [Parameter(ParameterSetName = InputObjectParameterSet)] + [Parameter] public PSCredential Credential { get; set; } /// /// Specifies the scope of installation. /// - [Parameter(ParameterSetName = NameParameterSet)] - [Parameter(ParameterSetName = InputObjectParameterSet)] + [Parameter] public ScopeType Scope { get; set; } /// /// Suppresses being prompted for untrusted sources. /// - [Parameter(ParameterSetName = NameParameterSet)] - [Parameter(ParameterSetName = InputObjectParameterSet)] + [Parameter] public SwitchParameter TrustRepository { get; set; } /// /// Overwrites a previously installed resource with the same name and version. /// - [Parameter(ParameterSetName = NameParameterSet)] - [Parameter(ParameterSetName = InputObjectParameterSet)] + [Parameter] public SwitchParameter Reinstall { get; set; } /// /// Suppresses progress information. /// - [Parameter(ParameterSetName = NameParameterSet)] - [Parameter(ParameterSetName = InputObjectParameterSet)] + [Parameter] public SwitchParameter Quiet { get; set; } /// /// For modules that require a license, AcceptLicense automatically accepts the license agreement during installation. /// - [Parameter(ParameterSetName = NameParameterSet)] - [Parameter(ParameterSetName = InputObjectParameterSet)] + [Parameter] public SwitchParameter AcceptLicense { get; set; } /// /// Prevents installing a package that contains cmdlets that already exist on the machine. /// - [Parameter(ParameterSetName = NameParameterSet)] + [Parameter] public SwitchParameter NoClobber { get; set; } /// @@ -108,8 +102,7 @@ class InstallPSResource : PSCmdlet /// /// Passes the resource installed to the console. /// - [Parameter(ParameterSetName = NameParameterSet)] - [Parameter(ParameterSetName = InputObjectParameterSet)] + [Parameter] public SwitchParameter PassThru { get; set; } /// diff --git a/src/code/SavePSResource.cs b/src/code/SavePSResource.cs index e9c456cd7..9060ef17e 100644 --- a/src/code/SavePSResource.cs +++ b/src/code/SavePSResource.cs @@ -63,27 +63,25 @@ public sealed class SavePSResource : PSCmdlet /// /// Specifies a user account that has rights to save a resource from a specific repository. /// - [Parameter(ParameterSetName = NameParameterSet)] - [Parameter(ParameterSetName = InputObjectParameterSet)] + [Parameter] public PSCredential Credential { get; set; } /// /// Saves the resource as a .nupkg /// - [Parameter()] + [Parameter] public SwitchParameter AsNupkg { get; set; } /// /// Saves the metadata XML file with the resource /// - [Parameter()] + [Parameter] public SwitchParameter IncludeXML { get; set; } /// /// The destination where the resource is to be installed. Works for all resource types. /// - [Parameter(ParameterSetName = NameParameterSet)] - [Parameter(ParameterSetName = InputObjectParameterSet)] + [Parameter] [ValidateNotNullOrEmpty] public string Path { @@ -110,14 +108,13 @@ public string Path /// /// Suppresses being prompted for untrusted sources. /// - [Parameter(ParameterSetName = NameParameterSet)] - [Parameter(ParameterSetName = InputObjectParameterSet)] + [Parameter] public SwitchParameter TrustRepository { get; set; } /// /// Passes the resource saved to the console. /// - [Parameter()] + [Parameter] public SwitchParameter PassThru { get; set; } /// diff --git a/src/code/UpdatePSResource.cs b/src/code/UpdatePSResource.cs index dc947e084..abf2c6034 100644 --- a/src/code/UpdatePSResource.cs +++ b/src/code/UpdatePSResource.cs @@ -100,7 +100,7 @@ public sealed class UpdatePSResource : PSCmdlet /// /// Passes the resource updated to the console. /// - [Parameter()] + [Parameter] public SwitchParameter PassThru { get; set; } /// From e4b6ee72c9d8456021bbef1f97818a8f8475e638 Mon Sep 17 00:00:00 2001 From: Amber Erickson Date: Thu, 2 Dec 2021 10:17:31 -0800 Subject: [PATCH 2/3] Update Get, Publish, Register, Set --- help/Get-PSResource.md | 2 +- help/Get-PSResourceRepository.md | 2 +- help/Install-PSResource.md | 2 +- help/Publish-PSResource.md | 32 ++++++++++----------------- help/Register-PSResourceRepository.md | 2 +- help/Set-PSResourceRepository.md | 32 +++++++++++++-------------- src/code/GetPSResource.cs | 4 ++-- src/code/PublishPSResource.cs | 16 +++++++------- 8 files changed, 42 insertions(+), 50 deletions(-) diff --git a/help/Get-PSResource.md b/help/Get-PSResource.md index e04f58b50..c52afbc2b 100644 --- a/help/Get-PSResource.md +++ b/help/Get-PSResource.md @@ -69,7 +69,7 @@ Aliases: Required: False Position: 0 Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) +Accept pipeline input: True (ByValue) Accept wildcard characters: True ``` diff --git a/help/Get-PSResourceRepository.md b/help/Get-PSResourceRepository.md index a2aeff8ea..35c32e0f3 100644 --- a/help/Get-PSResourceRepository.md +++ b/help/Get-PSResourceRepository.md @@ -81,7 +81,7 @@ Aliases: Required: False Position: 0 Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) +Accept pipeline input: True (ByValue) Accept wildcard characters: True ``` diff --git a/help/Install-PSResource.md b/help/Install-PSResource.md index 6be279d98..8272e9fbc 100644 --- a/help/Install-PSResource.md +++ b/help/Install-PSResource.md @@ -73,7 +73,7 @@ Aliases: Required: True Position: 0 Default value: None -Accept pipeline input: True +Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` diff --git a/help/Publish-PSResource.md b/help/Publish-PSResource.md index 247919a52..8c74c9dce 100644 --- a/help/Publish-PSResource.md +++ b/help/Publish-PSResource.md @@ -12,16 +12,8 @@ Publishes a specified module from the local computer to PSResource repository. ## SYNTAX -### PathParameterSet ``` -Publish-PSResource [-APIKey ] [-Repository ] [-Path] - [-Credential ] [-SkipDependenciesCheck] - [-WhatIf] [-Confirm] [] -``` - -### PathLiteralParameterSet -``` -Publish-PSResource [-APIKey ] [-Repository ] -LiteralPath +Publish-PSResource [-APIKey ] [-Repository ] [-Path] [-DestinationPath] [-Credential ] [-SkipDependenciesCheck] [-WhatIf] [-Confirm] [] ``` @@ -54,7 +46,7 @@ Specifies the API key that you want to use to publish a resource to the online g ```yaml Type: System.String -Parameter Sets: PathParameterSet, PathLiteralParameterSet +Parameter Sets: (All) Aliases: Required: False @@ -69,7 +61,7 @@ Specifies the repository to publish to. ```yaml Type: System.String -Parameter Sets: PathParameterSet, PathLiteralParameterSet +Parameter Sets: (All) Aliases: Required: False @@ -84,22 +76,22 @@ When specified, includes prerelease versions in search. ```yaml Type: System.String -Parameter Sets: PathParameterSet +Parameter Sets: (All) Aliases: Required: True Position: 0 Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) +Accept pipeline input: False Accept wildcard characters: False ``` -### -LiteralPath -Specifies a path to one or more locations. Unlike the Path parameter, the value of the LiteralPath parameter is used exactly as entered. No characters are interpreted as wildcards. If the path includes escape characters, enclose them in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences. +### -DestinationPath +Specifies the path to where the resource (as a nupkg) should be saved to. This parameter can be used in conjunction with the -Repository parameter to publish to a repository and also save the exact same package to the local file system. ```yaml Type: System.String -Parameter Sets: PathLiteralParameterSet +Parameter Sets: (All) Aliases: Required: True @@ -114,7 +106,7 @@ Specifies a user account that has rights to a specific repository (used for find ```yaml Type: System.Management.Automation.PSCredential -Parameter Sets: PathParameterSet, PathLiteralParameterSet +Parameter Sets: (All) Aliases: Required: False @@ -129,7 +121,7 @@ Bypasses the default check that all dependencies are present on the repository w ```yaml Type: System.Management.Automation.SwitchParameter -Parameter Sets: PathParameterSet, PathLiteralParameterSet +Parameter Sets: (All) Aliases: Required: False @@ -144,7 +136,7 @@ Prompts you for confirmation before running the cmdlet. ```yaml Type: System.Management.Automation.SwitchParameter -Parameter Sets: PathParameterSet, PathLiteralParameterSet +Parameter Sets: (All) Aliases: cf Required: False @@ -160,7 +152,7 @@ The cmdlet is not run. ```yaml Type: System.Management.Automation.SwitchParameter -Parameter Sets: PathParameterSet, PathLiteralParameterSet +Parameter Sets: (All) Aliases: wi Required: False diff --git a/help/Register-PSResourceRepository.md b/help/Register-PSResourceRepository.md index a676178d2..bf90cb349 100644 --- a/help/Register-PSResourceRepository.md +++ b/help/Register-PSResourceRepository.md @@ -139,7 +139,7 @@ Specifies whether the repository should be trusted. ```yaml Type: SwitchParameter -Parameter Sets: NameParameterSet, PSGalleryParameterSet +Parameter Sets: (All) Aliases: Required: False diff --git a/help/Set-PSResourceRepository.md b/help/Set-PSResourceRepository.md index a775ad574..b65cabe1a 100644 --- a/help/Set-PSResourceRepository.md +++ b/help/Set-PSResourceRepository.md @@ -87,7 +87,7 @@ Aliases: Required: True Position: 0 Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) +Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` @@ -102,30 +102,30 @@ Aliases: Required: False Position: Named Default value: None -Accept pipeline input: True (ByPropertyName) +Accept pipeline input: False Accept wildcard characters: False ``` -### -Repositories -Specifies a hashtable of repositories and is used to set multiple repositories at once. +### -Trusted +Specifies whether the repository should be trusted. ```yaml -Type: Hashtable[] -Parameter Sets: RepositoriesParameterSet +Type: System.Management.Automation.SwitchParameter +Parameter Sets: NameParameterSet Aliases: -Required: True +Required: False Position: Named Default value: None -Accept pipeline input: True (ByPropertyName) +Accept pipeline input: False Accept wildcard characters: False ``` -### -Trusted -Specifies whether the repository should be trusted. +### -URL +Specifies the location of the repository to be set. ```yaml -Type: System.Management.Automation.SwitchParameter +Type: String Parameter Sets: NameParameterSet Aliases: @@ -136,13 +136,13 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -URL -Specifies the location of the repository to be set. +### -PassThru +When specified, displays the succcessfully registered repository and its information ```yaml -Type: String -Parameter Sets: NameParameterSet -Aliases: +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf Required: False Position: Named diff --git a/src/code/GetPSResource.cs b/src/code/GetPSResource.cs index ab24dec78..facee6bf5 100644 --- a/src/code/GetPSResource.cs +++ b/src/code/GetPSResource.cs @@ -34,14 +34,14 @@ public sealed class GetPSResource : PSCmdlet /// /// Specifies the version of the resource to include to look for. /// - [Parameter()] + [Parameter] [ValidateNotNullOrEmpty()] public string Version { get; set; } /// /// Specifies the path to look in. /// - [Parameter()] + [Parameter] [ValidateNotNullOrEmpty()] public string Path { get; set; } diff --git a/src/code/PublishPSResource.cs b/src/code/PublishPSResource.cs index 1797eccd8..e46487cec 100644 --- a/src/code/PublishPSResource.cs +++ b/src/code/PublishPSResource.cs @@ -32,14 +32,14 @@ public sealed class PublishPSResource : PSCmdlet /// /// Specifies the API key that you want to use to publish a module to the online gallery. /// - [Parameter()] + [Parameter] [ValidateNotNullOrEmpty] public string ApiKey { get; set; } /// /// Specifies the repository to publish to. /// - [Parameter()] + [Parameter] [ValidateNotNullOrEmpty] [ArgumentCompleter(typeof(RepositoryNameCompleter))] public string Repository { get; set; } @@ -48,7 +48,7 @@ public sealed class PublishPSResource : PSCmdlet /// Specifies the path to the resource that you want to publish. This parameter accepts the path to the folder that contains the resource. /// Specifies a path to one or more locations. Wildcards are permitted. The default location is the current directory (.). /// - [Parameter()] + [Parameter] [ValidateNotNullOrEmpty] public string Path { @@ -75,7 +75,7 @@ public string Path /// Specifies the path to where the resource (as a nupkg) should be saved to. This parameter can be used in conjunction with the /// -Repository parameter to publish to a repository and also save the exact same package to the local file system. /// - [Parameter()] + [Parameter] [ValidateNotNullOrEmpty] public string DestinationPath { @@ -111,21 +111,21 @@ public string DestinationPath /// /// Specifies a user account that has rights to a specific repository (used for finding dependencies). /// - [Parameter()] + [Parameter] [ValidateNotNullOrEmpty] public PSCredential Credential { get; set; } /// /// Bypasses the default check that all dependencies are present. /// - [Parameter()] + [Parameter] [ValidateNotNullOrEmpty] public SwitchParameter SkipDependenciesCheck { get; set; } /// /// Specifies a proxy server for the request, rather than a direct connection to the internet resource. /// - [Parameter()] + [Parameter] [ValidateNotNullOrEmpty] public Uri Proxy { set @@ -142,7 +142,7 @@ public Uri Proxy { /// /// Specifies a user account that has permission to use the proxy server that is specified by the Proxy parameter. /// - [Parameter()] + [Parameter] [ValidateNotNullOrEmpty] public PSCredential ProxyCredential { set From 3d6c3f5bd6af385d2d15e71d29abbe26d81f38ac Mon Sep 17 00:00:00 2001 From: Amber Erickson Date: Thu, 2 Dec 2021 13:38:56 -0800 Subject: [PATCH 3/3] Update Save documentation --- help/Save-PSResource.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/help/Save-PSResource.md b/help/Save-PSResource.md index ae2ae400e..8e9f667af 100644 --- a/help/Save-PSResource.md +++ b/help/Save-PSResource.md @@ -15,13 +15,13 @@ Saves resources (modules and scripts) from a registered repository onto the mach ### NameParameterSet ``` Save-PSResource [-Name] [-Version ] [-Prerelease] [-Repository ] - [-Credential ] [-AsNupkg] [-IncludeXML] [-Path ] [-TrustRepository] [-SkipDependencyCheck] [-PassThru] [-WhatIf] [-Confirm] [] + [-Credential ] [-AsNupkg] [-IncludeXML] [-Path ] [-TrustRepository] [-SkipDependencyCheck] [-PassThru] [-Quiet] [-WhatIf] [-Confirm] [] ``` ### InputObjectParameterSet ``` Save-PSResource [-InputObject] [-Credential ] [-AsNupkg] - [-IncludeXML] [-Path ] [-TrustRepository] [-SkipDependencyCheck] [-PassThru] [-WhatIf] [-Confirm] [] + [-IncludeXML] [-Path ] [-TrustRepository] [-SkipDependencyCheck] [-PassThru] [-Quiet] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -230,6 +230,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Quiet +Supresses progress information. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -InputObject Used for pipeline input.