Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot install psget

Tags:

powershell

I am trying to install psget on windows 10 from powershell in admin mode but I get:

PS C:\Windows\system32> (new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1") | iex
Downloading PsGet from https://github.com/psget/psget/raw/master/PsGet/PsGet.psm1
Invoke-WebRequest : The given path's format is not supported.
At line:42 char:13
+             Invoke-WebRequest -Uri $Url -OutFile $SaveToLocation
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotImplemented: (:) [Invoke-WebRequest], NotSupportedException
    + FullyQualifiedErrorId : WebCmdletIEDomNotSupportedException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Import-Module : The specified module 'C:\Users\myuser\Documents\WindowsPowerShell\Modules C:\Users\myuser\Documents\WindowsPowerShell\Modules\PsGet' was not loaded
because no valid module file was found in any module directory.
At line:105 char:9
+         Import-Module -Name $Destination\PsGet
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (C:\Users\myuser\Do...l\Modules\PsGet:String) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

PsGet is installed and ready to use
USAGE:
    PS> import-module PsGet
    PS> install-module PsUrl

For more details:
    get-help install-module
Or visit http://psget.net
PS C:\Windows\system32>

As suggested below PsGet is actually already installed on windows 10. I have then continued with the next step:

enter image description here

and as can be seen it installs successfully (needs to be done running as administrator). After a restart of the powershell console I still don't get any color highlighting though:

enter image description here

Any ideas?

Btw: the folder C:\Users[my-user]\Documents\WindowsPowerShell\Modules is empty:

enter image description here

like image 327
u123 Avatar asked Sep 07 '16 16:09

u123


2 Answers

Um... psget as in PowerShellGet module that I am almost certain comes on Win 10. I believe your error is even telling you that. Where it says PsGet is installed and ready to use.

like image 50
Patrick Mcvay Avatar answered Oct 17 '22 22:10

Patrick Mcvay


Looks like the script at http://psget.net/GetPsGet.ps1 tries to decide where to install by querying for @($env:PSModulePath -split ';') and then limit the search for paths under Documents\WindowsPowerShell\Modules.

It appears that in your computer, PSModulePath includes twice the folder C:\Users\myuser\Documents\WindowsPowerShell\Modules, which causes an issue with the installation script.

You can do either one of these two options to solve it:

  1. Remove one instance of C:\Users\myuser\Documents\WindowsPowerShell\Modules from the PSModulePath variable.
  2. Install PsGet manually using the instructions in the official website.
like image 2
Tomer Avatar answered Oct 17 '22 22:10

Tomer