Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Set-PackageSource

Set-PackageSource

microsoft.powershell.packagemanagement.dll, microsoft.powershell.oneget.dll

Synopsis

Replaces a package source for a specified package provider.

Syntax

Set-PackageSource [-Name] [-Force] [-ForceBootstrap] [-Location] [-NewLocation] [-NewName] [-Trusted] [-Provider] [-Confirm] [-WhatIf] [<CommonParameters>]

Set-PackageSource [-Force] [-ForceBootstrap] [-NewLocation] [-NewName] [-Trusted] [-InputObject] [-Confirm] [-WhatIf] [<CommonParameters>]

Detailed Description

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

Parameters

-Force <SwitchParameter>

Suppresses the confirmation prompt. Without this parameter, Set-PackageSource prompts you to confirm that you want to change an existing source.

Aliases

None

Required?

false

Position

named

Default value

Accept pipeline input?

false

Accept wildcard characters?

false

-ForceBootstrap <SwitchParameter>

Forces OneGet to bootstrap—or automatically install—the package provider for the specified package source.

Aliases

None

Required?

false

Position

named

Default value

Accept pipeline input?

false

Accept wildcard characters?

false

-InputObject <PackageSource>

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.

Aliases

None

Required?

true

Position

named

Default value

Accept pipeline input?

True (ByValue)

Accept wildcard characters?

false

-Location <String>

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.

Aliases

None

Required?

false

Position

named

Default value

Accept pipeline input?

false

Accept wildcard characters?

false

-Name <String>

Specifies the current friendly name of a package source.

Aliases

SourceName

Required?

false

Position

1

Default value

Accept pipeline input?

false

Accept wildcard characters?

false

-NewLocation <String>

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.

Aliases

None

Required?

false

Position

named

Default value

Accept pipeline input?

false

Accept wildcard characters?

false

-NewName <String>

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

Aliases

None

Required?

false

Position

named

Default value

Accept pipeline input?

false

Accept wildcard characters?

false

-Provider <String>

Specifes the name of the package source’s provider.

Aliases

ProviderName

Required?

true

Position

named

Default value

Accept pipeline input?

True (ByPropertyName)

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.

Aliases

None

Required?

false

Position

named

Default value

Accept pipeline input?

false

Accept wildcard characters?

false

-Confirm <SwitchParameter>

Prompts you for confirmation before running the cmdlet.

Aliases

None

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.

Aliases

None

Required?

false

Position

named

Default value

false

Accept pipeline input?

false

Accept wildcard characters?

false

Input Type


Return Type


Notes

None

Examples

Example 1: Change a package source

This example 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.

PS C:\>Set-PackageSource -Name psRep –NewName 'ps-Feature-Rep' –Trusted –ProviderName PSModule

Online Version
Get-PackageSource
Register-PackageSource
Unregister-PackageSource