< Back

Set-PackageSource

Sat Jan 18, 2020 6:24 pm

NAME Set-PackageSource



SYNOPSIS

Replaces a package source for a specified package provider.





SYNTAX

Set-PackageSource [-ConfigFile <String>] [-Confirm] [-Credential <PSCredential>] [-Force] [-ForceBootstrap]

[-NewLocation <String>] [-NewName <String>] [-Proxy <Uri>] [-ProxyCredential <PSCredential>] [-SkipValidate]

[-Trusted] [-WhatIf] [<CommonParameters>]



Set-PackageSource [-ConfigFile <String>] [-Confirm] [-Credential <PSCredential>] [-Force] [-ForceBootstrap]

[-NewLocation <String>] [-NewName <String>] [-Proxy <Uri>] [-ProxyCredential <PSCredential>] [-SkipValidate]

[-Trusted] [-WhatIf] [<CommonParameters>]



Set-PackageSource [-Confirm] [-Credential <PSCredential>] [-Force] [-ForceBootstrap] -InputObject <PackageSource>

[-NewLocation <String>] [-NewName <String>] [-Proxy <Uri>] [-ProxyCredential <PSCredential>] [-Trusted] [-WhatIf]

[<CommonParameters>]



Set-PackageSource [[-Name] <String>] [-Confirm] [-Credential <PSCredential>] [-Force] [-ForceBootstrap] [-Location

<String>] [-NewLocation <String>] [-NewName <String>] [-ProviderName {msi | NuGet | msu | Programs | PowerShellGet

| psl | chocolatey}] [-Proxy <Uri>] [-ProxyCredential <PSCredential>] [-Trusted] [-WhatIf] [<CommonParameters>]



Set-PackageSource [-Confirm] [-Credential <PSCredential>] [-Force] [-ForceBootstrap] [-NewLocation <String>]

[-NewName <String>] [-PackageManagementProvider <String>] [-Proxy <Uri>] [-ProxyCredential <PSCredential>]

[-PublishLocation <String>] [-ScriptPublishLocation <String>] [-ScriptSourceLocation <String>] [-Trusted]

[-WhatIf] [<CommonParameters>]



Set-PackageSource [-Confirm] [-Credential <PSCredential>] [-Force] [-ForceBootstrap] [-NewLocation <String>]

[-NewName <String>] [-PackageManagementProvider <String>] [-Proxy <Uri>] [-ProxyCredential <PSCredential>]

[-PublishLocation <String>] [-ScriptPublishLocation <String>] [-ScriptSourceLocation <String>] [-Trusted]

[-WhatIf] [<CommonParameters>]





DESCRIPTION

The Set-PackageSource replaces a package source for a specified package provider. Package sources are always

managed by a package provider.





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 forces Package Management to automatically install the package provider for the

specified package source.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-InputObject <PackageSource>

Specifies a package source ID object that represents the package that you want to change. Package source IDs

are part of the results of the Get-PackageSource cmdlet.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-Location <String>

Specifies the location to which a package source currently points. The value of this parameter can be a URI, a

file path, or any other destination format supported by the package provider.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

Specifies the current friendly name of a package source.



Required? false

Position? 0

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-NewLocation <String>

Specifies the new location to which you want a package source to point. The value of this parameter can be a

URI, a file path, or any other destination format supported by the package provider.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-NewName <String>

Specifies the new friendly name that you want to assign to a package source.



Required? false

Position? named

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 whether users trust packages from this source; that is, indicates whether users are prompted to

verify that they trust the package source before they install a package from it. If you add this parameter,

users are not prompted.



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

You cannot pipe input to this cmdlet.

This cmdlet does not generate any output.





OUTPUTS



NOTES









Example 1: Change a package source



PS C:\\>Set-PackageSource -Name "PsRep" -NewName "PS-Feature-Rep" -Trusted -ProviderName "PSModule"



This command changes the friendly name of a package source for the PSModule provider. It also changes the package

source to be trusted, so that users who install packages from this source are not prompted to verify that they

trust the source.



RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkID=517141

about_PackageManagement

Get-PackageSource

Register-PackageSource

Unregister-PackageSource