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
 

Unregister-PackageSource

Unregister-PackageSource

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

Synopsis

Removes a registered package source.

Syntax

Unregister-PackageSource [-Credential] [-Force] [-ForceBootstrap] [-InputObject] [-Confirm] [-WhatIf] [<CommonParameters>]

Unregister-PackageSource [-Source] [-Credential] [-Force] [-ForceBootstrap] [-Location] [-Provider] [-Confirm] [-WhatIf] [<CommonParameters>]

Detailed Description

Unregister-PackageSource removes a registered package source. Package sources are always managed by a package provider.

Parameters

-Credential <PSCredential>

Specifies a user account that has rights to unregister a package source for a specified package provider. Specify a user name, such as "User01", or "Domain\User01", or specify a PSCredential object, such as one generated by the Get-Credential cmdlet. The simplest way to specify a PSCredential object is to save the results of a Get-Credential cmdlet as a variable. When you add this parameter and specify a user name, you are prompted to provide a password after you run the command.

Aliases

None

Required?

false

Position

named

Default value

Accept pipeline input?

false

Accept wildcard characters?

false

-Force <SwitchParameter>

Forces the unregistration without prompting you to confirm.

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[]>

Specifies a package source by using the package source’s object, which is shown in 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 points. The value of this parameter can be a URI, a file path, or any other destination format that is supported by the package provider.

Aliases

None

Required?

false

Position

named

Default value

Accept pipeline input?

false

Accept wildcard characters?

false

-Provider <String>

Specifies the provider name.

Aliases

ProviderName

Required?

false

Position

named

Default value

Accept pipeline input?

True (ByPropertyName)

Accept wildcard characters?

false

-Source <String>

Specifies the friendly name of the package source.

Aliases

Name

Required?

true

Position

1

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: Unregister a package source for the NuGet provider

This example unregisters a package source named Features for the NuGet provider. Because the Force parameter isn’t added, you are prompted to confirm that you want to unregister the package.

PS C:\>Unregister-PackageSource -Source 'myRep' -Location 'http://contoso/nuget/MyRepository/api/v3' –Provider 'nuget'

Example 2: Unregister a package source by piping a PackageSource object

This example unregisters a package source named Features for the NuGet provider by saving the results of a Get-PackageSource command to a variable, and then using the variable as input to Unregister-PackageSource. The Force parameter ensures that you are not prompted to confirm that you want to unregister the package.

PS C:\>$a = Get-PackageSource –Name 'myRep' –Location 'http://contoso/nuget/Features/api/v3'
PS C:\>Unregister-PackageSource –InputObject $a -Force

Online Version
Get-PackageSource
Register-PackageSource
Set-PackageSource