header image

PowerShell repositories

Posted by: | September 17, 2016 Comments Off on PowerShell repositories |

A reader on my blog asked if you can unregister the default PowerShell repository so you just use an internal repository.

 

First off – PSGallery is the default repository

PS> Get-PSRepository | Format-List

Name                      : PSGallery
SourceLocation            : https://www.powershellgallery.com/api/v2/
Trusted                   : False
Registered                : True
InstallationPolicy        : Untrusted
PackageManagementProvider : NuGet
PublishLocation           : https://www.powershellgallery.com/api/v2/package/
ScriptSourceLocation      : https://www.powershellgallery.com/api/v2/items/psscript/
ScriptPublishLocation     : https://www.powershellgallery.com/api/v2/package/
ProviderOptions           : {}

 

According to the documentation for Unregister-PSRepository you CAN’T unregister the default repository. In fact you can – the documentation appears to be incorrect

 

You can unregister PSGallery  with

Get-PSRepository -Name PSGallery | Unregister-PSRepository

NOTE You have to do this on a user by user basis

 

If you decide you need the default repository again then you can register it like this:

Register-PSRepository –Default

under: PowerShell v5

Comments are closed.

Categories