Edit

Share via


Reset-PSResourceRepository

Creates a new default PSRepositories.xml file with PSGallery registered.

Syntax

Default (Default)

Reset-PSResourceRepository
    [-PassThru]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

This command resets the repository store by creating a store file with PSGallery registered. 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.

This command was added in Microsoft.PowerShell.PSResourceGet v1.2.0-preview5.

Examples

Example 1 - Reset the repository store and display the results

Reset-PSResourceRepository -PassThru
Name            Uri                                      Trusted Priority IsAllowedByPolicy
----            ---                                      ------- -------- -----------------
PSGallery       https://www.powershellgallery.com/api/v2 True    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 does not 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.

Inputs

None

Outputs

Microsoft.PowerShell.PSResourceGet.UtilClasses.PSRepositoryInfo