< Back

Register-PSRepository

Wed Jan 30, 2019 5:57 pm

NAME Register-PSRepository



SYNOPSIS

Registers a PowerShell repository.





SYNTAX

Register-PSRepository [-Name] <String> [-SourceLocation] <Uri> [-Credential <PSCredential>] [-InstallationPolicy {Trusted | Untrusted}]

[-PackageManagementProvider <String>] [-Proxy <Uri>] [-ProxyCredential <PSCredential>] [-PublishLocation <Uri>] [-ScriptPublishLocation <Uri>]

[-ScriptSourceLocation <Uri>] [<CommonParameters>]



Register-PSRepository -Default [-InstallationPolicy {Trusted | Untrusted}] [-Proxy <Uri>] [-ProxyCredential <PSCredential>] [<CommonParameters>]





DESCRIPTION

The Register-PSRepository cmdlet registers the default repository for PowerShell modules. After a repository is registered, you can reference it from

the Find-Module, Install-Module, and Publish-Module cmdlets. The registered repository becomes the default repository in Find-Module and Install-Module .



Registered repositories are user-specific. They are not registered in a system-wide context.



Each registered repository is associated with a OneGet package provider, which is specified with the PackageManagementProvider parameter. Each OneGet

provider is designed to interact with a specific type of repository. For example, the NuGet provider is designed to interact with NuGet-based

repositories. If a OneGet provider is not specified during registration, PowerShellGet attempts to find a OneGet provider that can handle the specified

source location.





PARAMETERS

-Credential <PSCredential>

@{Text=}



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Default [<SwitchParameter>]

@{Text=}



Required? true

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-InstallationPolicy <String>

@{Text=}



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

@{Text=}



Required? true

Position? 0

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-PackageManagementProvider <String>

@{Text=}



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Proxy <Uri>

@{Text=}



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ProxyCredential <PSCredential>

@{Text=}



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-PublishLocation <Uri>

@{Text=}



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ScriptPublishLocation <Uri>

@{Text=}



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ScriptSourceLocation <Uri>

@{Text=}



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-SourceLocation <Uri>

@{Text=}



Required? true

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES









Example 1: Register a repository



PS C:\\>Register-PSRepository -Name "myNuGetSource" -SourceLocation "https://www.myget.org/F/powershellgetdemo/api/v2" -PublishLocation

"https://www.myget.org/F/powershellgetde ... 2/Packages" -InstallationPolicy Trusted

PS C:\\>Get-PSRepository

Name SourceLocation OneGetProvider InstallationPolicy

---- -------------- -------------- ------------------

PSGallery http://go.micro... NuGet Untrusted

myNuGetSource https://myget.c... NuGet Trusted



The first command registers https://www.myget.org/F/powershellgetdemo/ as a repository for the current user. After myNuGetSource is registered, you can

explicitly reference it when searching for, installing, and publishing modules. Because the PackageManamentProvider parameter isn't specified, the

repository is not explicitly associated with a OneGet packkage provider, so PowerShellGet polls available package providers and associates it with the

NuGet provider.



The second command gets registered repositories and displays the results.



RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkId=821668

Get-PSRepository

Set-PSRepository

Unregister-PSRepository