我试图在admin模式下从powershell在Windows 10上安装psget,但得到:
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>
如下面的建议,PsGet实际上已经安装在Windows 10上。然后,我继续下一步:
并且可以看到它安装成功(需要以管理员身份运行)。重新启动Powershell控制台后,我仍然看不到任何突出显示的颜色:
有任何想法吗?
顺便说一句:文件夹 C:\Users [my-user]\Documents\WindowsPowerShell\Modules 为空:
最佳答案
嗯...几乎可以肯定,Win 10上的PowerShellGet模块中的psget会出现在Win 10上。我相信您的错误甚至在告诉您。它说PsGet已安装并可以使用。
关于powershell - 无法安装psget,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/39375539/