| external help file | Microsoft.PowerShell.PackageManagement.dll-Help.xml |
|---|---|
| Locale | en-US |
| Module Name | PackageManagement |
| ms.date | 12/12/2022 |
| online version | https://learn.microsoft.com/powershell/module/packagemanagement/unregister-packagesource?view=powershellget-1.x&WT.mc_id=ps-gethelp |
| schema | 2.0.0 |
| title | Unregister-PackageSource |
Removes a registered package source.
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>]
The Unregister-PackageSource cmdlet removes a registered package source. Package sources are
always managed by a package provider. To find package sources, use the Get-PackageSource cmdlet.
The Unregister-PackageSource cmdlet unregisters a package source from the local computer. The
Location and Provider parameters can be used to further specify the source to remove.
PS> Unregister-PackageSource -Source MyNuGet
The Unregister-PackageSource cmdlet uses the Source parameter to specify which source to
remove.
This example uses the Get-PackageSource and Unregister-PackageSource to unregister a package
source. The PackageSource object is stored in a variable.
PS> $pkgsource = Get-PackageSource -Name MyNuGet
PS> Unregister-PackageSource -InputObject $pkgsource
The $pkgsource variable stores the PackageSource created by the Get-PackageSource cmdlet.
Unregister-PackageSource uses the $pkgsource as input to the InputObject parameter.
As an alternative, the Unregister-PackageSource cmdlet can specify a value for the InputObject
parameter:
Unregister-PackageSource -InputObject ( Get-PackageSource -Name MyNuGet )
Specifies a configuration file.
Type: System.String
Parameter Sets: NuGet:SourceByInputObject, NuGet:SourceBySearch
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies a user account that has permission to access the computer and run commands. Type a user
name, such as User01, Domain01\User01, or enter a PSCredential object, generated by the
Get-Credential cmdlet. If you type a user name, you're prompted for a password.
When the Credential parameter isn't specified, the current user account is used.
Type: System.Management.Automation.PSCredential
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseForces the command to run without asking for user confirmation. Overrides restrictions that prevent
Unregister-PackageSource from succeeding, with the exception of security.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseIndicates that Unregister-PackageSource forces PackageManagement to automatically uninstall
the package provider for the specified package source.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseAccepts pipeline input that specifies the PackageSource object from the Get-PackageSource
cmdlet. InputObject accepts the PackageSource object as a Get-PackageSource value or a
variable that contains the object.
Type: Microsoft.PackageManagement.Packaging.PackageSource[]
Parameter Sets: SourceByInputObject
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseSpecifies 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: System.String
Parameter Sets: SourceBySearch
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the PackageManagement provider.
Type: System.String
Parameter Sets: PowerShellGet:SourceByInputObject, PowerShellGet:SourceBySearch
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the provider name.
Type: System.String
Parameter Sets: SourceBySearch
Aliases: Provider
Accepted values: Bootstrap, NuGet, PowerShellGet
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseSpecifies the publish location.
Type: System.String
Parameter Sets: PowerShellGet:SourceByInputObject, PowerShellGet:SourceBySearch
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the script publish location.
Type: System.String
Parameter Sets: PowerShellGet:SourceByInputObject, PowerShellGet:SourceBySearch
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the script source location.
Type: System.String
Parameter Sets: PowerShellGet:SourceByInputObject, PowerShellGet:SourceBySearch
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSwitch that skips validating the credentials of a package source.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: NuGet:SourceByInputObject, NuGet:SourceBySearch
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the friendly name of the package source.
Type: System.String
Parameter Sets: SourceBySearch
Aliases: Name
Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalsePrompts you for confirmation before Unregister-PackageSource is run.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseShows what would happen if Unregister-PackageSource cmdlet is run. The cmdlet isn't run.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
You can pipe a PackageSource object to this cmdlet
This cmdlet returns no output.
Including a package provider in a command can make dynamic parameters available to a cmdlet. Dynamic
parameters are specific to a package provider. The Get-Help cmdlet lists a cmdlet's parameter sets
and includes the provider's parameter set.
Get-Credential