PSResourceGet icon indicating copy to clipboard operation
PSResourceGet copied to clipboard

Add a Rename-PSResourceRepository cmdlet

Open ThomasNieto opened this issue 3 years ago • 0 comments

Summary of the new feature / enhancement

Currently the only way to rename a resource repository is to first unregister and then register it again. To make this easier for the user please introduce a Rename-PSResourceRepository.

Proposed technical implementation details (optional)

SYNTAX
    Rename-PSResourceRepository [-Name] <string> [-NewName] <string> [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
function Rename-PSResourceRepository {
    [CmdletBinding(SupportsShouldProcess)]
    param (
        [Parameter(Mandatory, Position = 0, ValueFromPipeline, ValueFromPipelineByPropertyName)]
        [string]
        $Name,

        [Parameter(Mandatory, Position = 1, ValueFromPipelineByPropertyName)]
        [string]
        $NewName,

        [Parameter()]
        [switch]
        $PassThru
    )
    
    process {
        if ($PSCmdlet.ShouldProcess($Name)) {
            # Rename repository
        }
    }
}

ThomasNieto avatar Jul 18 '22 18:07 ThomasNieto