< Back

Unregister-PackageSource

Sat Jan 18, 2020 6:24 pm

NAME Unregister-PackageSource



SYNOPSIS

Removes a registered package source.





SYNTAX

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

[-SkipValidate] [-WhatIf] [<CommonParameters>]



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

[-SkipValidate] [-WhatIf] [<CommonParameters>]



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

<PackageSource[]> [-WhatIf] [<CommonParameters>]



Unregister-PackageSource [[-Source] <String>] [-Confirm] [-Credential <PSCredential>] [-Force] [-ForceBootstrap]

[-Location <String>] [-ProviderName {msi | NuGet | msu | Programs | PowerShellGet | psl | chocolatey}] [-WhatIf]

[<CommonParameters>]



Unregister-PackageSource [-Confirm] [-Credential <PSCredential>] [-Force] [-ForceBootstrap]

[-PackageManagementProvider <String>] [-PublishLocation <String>] [-ScriptPublishLocation <String>]

[-ScriptSourceLocation <String>] [-WhatIf] [<CommonParameters>]



Unregister-PackageSource [-Confirm] [-Credential <PSCredential>] [-Force] [-ForceBootstrap]

[-PackageManagementProvider <String>] [-PublishLocation <String>] [-ScriptPublishLocation <String>]

[-ScriptSourceLocation <String>] [-WhatIf] [<CommonParameters>]





DESCRIPTION

The Unregister-PackageSource cmdlet removes a registered package source. 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 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.



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 by using the package source's object, which is shown in 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 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.



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



-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



-Source <String>

Specifies the friendly name of the package source.



Required? false

Position? 0

Default value None

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.







OUTPUTS

This cmdlet does not generate any output.







NOTES









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.



RELATED LINKS

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

about_PackageManagement

Get-PackageSource

Register-PackageSource

Set-PackageSource