Unregister-Package Source

Removes a registered package source.

Syntax

Unregister-PackageSource
          [[-Source] <String>]
          [-Location <String>]
          [-Credential <PSCredential>]
          [-Force]
          [-ForceBootstrap]
          [-WhatIf]
          [-Confirm]
          [-ProviderName <String>]
          [<CommonParameters>]
Unregister-PackageSource
          -InputObject <PackageSource[]>
          [-Credential <PSCredential>]
          [-Force]
          [-ForceBootstrap]
          [-WhatIf]
          [-Confirm]
          [<CommonParameters>]
Unregister-PackageSource
          [-Credential <PSCredential>]
          [-Force]
          [-ForceBootstrap]
          [-WhatIf]
          [-Confirm]
          [-ConfigFile <String>]
          [-SkipValidate]
          [<CommonParameters>]
Unregister-PackageSource
          [-Credential <PSCredential>]
          [-Force]
          [-ForceBootstrap]
          [-WhatIf]
          [-Confirm]
          [-ConfigFile <String>]
          [-SkipValidate]
          [<CommonParameters>]
Unregister-PackageSource
          [-Credential <PSCredential>]
          [-Force]
          [-ForceBootstrap]
          [-WhatIf]
          [-Confirm]
          [-PackageManagementProvider <String>]
          [-PublishLocation <String>]
          [-ScriptSourceLocation <String>]
          [-ScriptPublishLocation <String>]
          [<CommonParameters>]
Unregister-PackageSource
          [-Credential <PSCredential>]
          [-Force]
          [-ForceBootstrap]
          [-WhatIf]
          [-Confirm]
          [-PackageManagementProvider <String>]
          [-PublishLocation <String>]
          [-ScriptSourceLocation <String>]
          [-ScriptPublishLocation <String>]
          [<CommonParameters>]

Description

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

Examples

Example 1: Unregister a package source for the Nuget provider

PS C:\> Unregister-PackageSource -Source "MyRep" -Location "http://contoso/nuget/MyRepository/api/v3" -Provider "Nuget"

This command unregisters a package source named Features for the Nuget provider. You are prompted to confirm that you want to unregister the package because the Force parameter is not specified,

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

PS C:\> $A = Get-PackageSource -Name "MyRep" -Location "http://contoso/nuget/Features/api/v3"

PS C:\> Unregister-PackageSource -InputObject $A -Force

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

Required Parameters

-InputObject

Specifies a package source by using the package source's object, which is shown in the results of the Get-PackageSource cmdlet.

Type: PackageSource[]
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

Optional Parameters

-ConfigFile

{{Fill ConfigFile Description}}

Type: String
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Aliases: cf
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Credential

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.

Type: PSCredential
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Force

Forces the command to run without asking for user confirmation.

Type: SwitchParameter
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ForceBootstrap

Indicates that this cmdlet forces Package Management to automatically install the package provider for the specified package source.

Type: SwitchParameter
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Location

Specifies 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.

Type: String
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-PackageManagementProvider

Specifies the Package Management provider.

Type: String
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProviderName

Specifies the provider name.

Type: String
Aliases: Provider
Parameter Sets: Programs, msi, msu, PowerShellGet, nuget, chocolatey
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-PublishLocation

Specifies the publish location.

Type: String
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ScriptPublishLocation

Specifies the script publish location.

Type: String
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ScriptSourceLocation

Specifies the script source location.

Type: String
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-SkipValidate

{{Fill SkipValidate Description}}

Type: SwitchParameter
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Source

Specifies the friendly name of the package source.

Type: String
Aliases: Name
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Aliases: wi
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

Inputs

You cannot pipe input to this cmdlet.

Outputs

This cmdlet does not generate any output.