Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Whom you miss PSGallery with Get-PSRepository!
Register-PSRepository -Name PSGallery -SourceLocation https://www.powershellgallery.com/api/v2/ -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/ -InstallationPolicy Trusted -PackageManagementProvider NuGet
@guitarrapc

This comment has been minimized.

Copy link
Owner Author

guitarrapc commented May 31, 2016

After run it, you can use Find-Module for PSGallery.

image
image

@davidwallis3101

This comment has been minimized.

Copy link

davidwallis3101 commented Sep 13, 2016

Register-PSRepository -Default with WMF 5.1 it seems

@sir-Higgins

This comment has been minimized.

Copy link

sir-Higgins commented Apr 19, 2017

Corporate Proxy
I'm Behind a corporate proxy with windows authentication
I had to run the following lines for Register-PSRepository -Default to work

[system.net.webrequest]::defaultwebproxy = new-object system.net.webproxy('http://[YourProxyDNS]:[yourProxyPort]') [system.net.webrequest]::defaultwebproxy.credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials [system.net.webrequest]::defaultwebproxy.BypassProxyOnLocal = $true

Powershell Profile
You can add these lignes in your powershell profile

Create the profile file if you don't have one
New-Item -path $PROFILE -type file –force

Edit the profile file
notepad $PROFILE

@uemoe

This comment has been minimized.

Copy link

uemoe commented Jan 3, 2018

@sir-Higgins Thank you very helpful comment.

@Xeleema

This comment has been minimized.

Copy link

Xeleema commented Jan 5, 2018

This helped me set things up on a Windows Server 2012 R2 system, running PowerShell v4.0.

  1. Installed "PackageManagement PowerShell Modules Preview - March 2016"

  2. Ran the following command you provided;

Register-PSRepository -Name PSGallery
-SourceLocation https://www.powershellgallery.com/api/v2/
-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/
-InstallationPolicy Trusted -PackageManagementProvider NuGet

  1. Tested by installing the "SpeculationControl" module from Microsoft's PowerShell Gallery;

Save-Module -Name SpeculationControl -Path C:\Path\To\PowerShell\Modules\

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.