< Back
Register-PackageSource
Post
NAME Register-PackageSource
SYNOPSIS
Adds a package source for a specified package provider.
SYNTAX
Register-PackageSource [[-Name] <String>] [[-Location] <String>] [-ConfigFile <String>] [-Confirm] [-Credential
<PSCredential>] [-Force] [-ForceBootstrap] [-Proxy <Uri>] [-ProxyCredential <PSCredential>] [-SkipValidate]
[-Trusted] [-WhatIf] [<CommonParameters>]
Register-PackageSource [[-Name] <String>] [[-Location] <String>] [-Confirm] [-Credential <PSCredential>] [-Force]
[-ForceBootstrap] [-PackageManagementProvider <String>] [-Proxy <Uri>] [-ProxyCredential <PSCredential>]
[-PublishLocation <String>] [-ScriptPublishLocation <String>] [-ScriptSourceLocation <String>] [-Trusted]
[-WhatIf] [<CommonParameters>]
Register-PackageSource [[-Name] <String>] [[-Location] <String>] [-Confirm] [-Credential <PSCredential>] [-Force]
[-ForceBootstrap] [-ProviderName {msi | NuGet | msu | Programs | PowerShellGet | psl | chocolatey}] [-Proxy <Uri>]
[-ProxyCredential <PSCredential>] [-Trusted] [-WhatIf] [<CommonParameters>]
DESCRIPTION
The Register-PackageSource cmdlet adds a package source for a specified package provider. Package sources are
always managed by a package provider. If the package provider cannot add or replace a package source, the provider
generates an error message.
PARAMETERS
-ConfigFile <String>
{{Fill ConfigFile Description}}
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Confirm [<SwitchParameter>]
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-Credential <PSCredential>
Specifies a user account that has permission to install package providers.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Force [<SwitchParameter>]
Forces the command to run without asking for user confirmation.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-ForceBootstrap [<SwitchParameter>]
Indicates that this cmdlet automatically installs the package provider.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-Location <String>
Specifies the package source location.
Required? false
Position? 1
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Name <String>
Specifies the name of the package source to register.
Required? false
Position? 0
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-PackageManagementProvider <String>
Specifies the Package Management provider.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-ProviderName <String>
Specifies the provider name.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Proxy <Uri>
@{Text=}
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-ProxyCredential <PSCredential>
@{Text=}
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-PublishLocation <String>
Specifies the publish location.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-ScriptPublishLocation <String>
Specifies the script publish location.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-ScriptSourceLocation <String>
Specifies the script source location.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-SkipValidate [<SwitchParameter>]
{{Fill SkipValidate Description}}
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-Trusted [<SwitchParameter>]
Indicates that the package source is trusted.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
Default value False
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 package source for the NuGet provider
PS C:\\>Register-PackageSource -Name "MyRep" -Location "http://contoso/psmodule/Features/api/v3" -ProviderName
"PsModule"
This command registers a package source, a web-based location for the PSModule provider. If you do not add the
Trusted parameter, by default, the package is not trusted, and users are prompted to confirm that they trust the
source before installing packages from the source.
RELATED LINKS
Online Version: http://go.microsoft.com/fwlink/?LinkID=517139
about_PackageManagement
Get-PackageSource
Set-PackageSource
Unregister-PackageSource
SYNOPSIS
Adds a package source for a specified package provider.
SYNTAX
Register-PackageSource [[-Name] <String>] [[-Location] <String>] [-ConfigFile <String>] [-Confirm] [-Credential
<PSCredential>] [-Force] [-ForceBootstrap] [-Proxy <Uri>] [-ProxyCredential <PSCredential>] [-SkipValidate]
[-Trusted] [-WhatIf] [<CommonParameters>]
Register-PackageSource [[-Name] <String>] [[-Location] <String>] [-Confirm] [-Credential <PSCredential>] [-Force]
[-ForceBootstrap] [-PackageManagementProvider <String>] [-Proxy <Uri>] [-ProxyCredential <PSCredential>]
[-PublishLocation <String>] [-ScriptPublishLocation <String>] [-ScriptSourceLocation <String>] [-Trusted]
[-WhatIf] [<CommonParameters>]
Register-PackageSource [[-Name] <String>] [[-Location] <String>] [-Confirm] [-Credential <PSCredential>] [-Force]
[-ForceBootstrap] [-ProviderName {msi | NuGet | msu | Programs | PowerShellGet | psl | chocolatey}] [-Proxy <Uri>]
[-ProxyCredential <PSCredential>] [-Trusted] [-WhatIf] [<CommonParameters>]
DESCRIPTION
The Register-PackageSource cmdlet adds a package source for a specified package provider. Package sources are
always managed by a package provider. If the package provider cannot add or replace a package source, the provider
generates an error message.
PARAMETERS
-ConfigFile <String>
{{Fill ConfigFile Description}}
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Confirm [<SwitchParameter>]
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-Credential <PSCredential>
Specifies a user account that has permission to install package providers.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Force [<SwitchParameter>]
Forces the command to run without asking for user confirmation.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-ForceBootstrap [<SwitchParameter>]
Indicates that this cmdlet automatically installs the package provider.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-Location <String>
Specifies the package source location.
Required? false
Position? 1
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Name <String>
Specifies the name of the package source to register.
Required? false
Position? 0
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-PackageManagementProvider <String>
Specifies the Package Management provider.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-ProviderName <String>
Specifies the provider name.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Proxy <Uri>
@{Text=}
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-ProxyCredential <PSCredential>
@{Text=}
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-PublishLocation <String>
Specifies the publish location.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-ScriptPublishLocation <String>
Specifies the script publish location.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-ScriptSourceLocation <String>
Specifies the script source location.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-SkipValidate [<SwitchParameter>]
{{Fill SkipValidate Description}}
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-Trusted [<SwitchParameter>]
Indicates that the package source is trusted.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
Default value False
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 package source for the NuGet provider
PS C:\\>Register-PackageSource -Name "MyRep" -Location "http://contoso/psmodule/Features/api/v3" -ProviderName
"PsModule"
This command registers a package source, a web-based location for the PSModule provider. If you do not add the
Trusted parameter, by default, the package is not trusted, and users are prompted to confirm that they trust the
source before installing packages from the source.
RELATED LINKS
Online Version: http://go.microsoft.com/fwlink/?LinkID=517139
about_PackageManagement
Get-PackageSource
Set-PackageSource
Unregister-PackageSource