Reset-PSResourceRepository
Creates a new default PSRepositories.xml file with preregistered repositories.
Syntax
Default (Default)
Reset-PSResourceRepository
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
This command resets the repository store by creating a store file with preregistered repositories. First it creates a new temporary file and only replaces the old file if creation succeeds. If creation fails, the old file is restored.
Use this command to replace a corrupted repository store or to restore the default repository configuration. The default configuration includes the following repositories:
- MicrosoftArtifactRegistry (added in v1.3.0-preview1)
- Priority = 40
- Trusted = True
- PSGallery
- Priority = 50
- Trusted = False
This command was added in Microsoft.PowerShell.PSResourceGet v1.2.0.
Examples
Example 1 - Reset the repository store and display the results
Reset-PSResourceRepository -PassThru
Name Uri Trusted Priority IsAllowedByPolicy
---- --- ------- -------- -----------------
MicrosoftArtifactRegistry https://mcr.microsoft.com/ True 40 True
PSGallery https://www.powershellgallery.com/api/v2 False 50 True
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | cf |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-PassThru
By default, the command doesn't generate any output. When specified, the command displays the results of the reset operation.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet isn't run.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | wi |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.