请有人可以帮助我与Powershell。我是新手,有点迷路。安装PowerShellGet模块
我正在使用Windows 2012 R2,它运行的是Powershell版本4.0。我已升级到5.0版。
看来,当我做基本的命令,我得到的错误,例如
PS C:\Windows\system32> Install-Module –Name PowerShellGet –Force –Verbose
安装-模块:“安装-模块”命令模块 “PowerShellGet”中发现,但模块不能被加载。有关更多 信息,请运行“Import-Module PowerShellGet”。在线:1 char:1 + Install-Module -Name PowerShellGet -Force -Verbose + ~~~~~~~~~~~~~~~~~~安装模块:字符串[] ,CommandNotFoundException + FullyQualifiedErrorId:CouldNotAutoloadMatchingModule
又如:
PS C:\Windows\system32> import-module PowerShellGet
获取变量:术语 '获取变量' 不被识别为名称的cmdlet的 ,函数,脚本文件或可操作程序。检查名称的拼写,或者如果包含路径,请确认路径 是正确的,然后重试。在C:\ Program Files \ WindowsPowerShell \ Modules \ PowerShellGet \ 1.1.3.2 \ PSModule.psm1:18 char:28 + $ script:IsWindows =(-not(Get-Variable -Name IsWindows -ErrorAction ... + ~~~~~~~~~~~~ + CategoryInfo:ObjectNotFound:(获取变量:字符串)[],CommandNotFoundException + FullyQualifiedErrorId:CommandNotFoundException
我基本上按照对PowerShellGet安装方法这里找到:https://docs.microsoft.com/en-us/powershell/gallery/psget/get_psget_module
我卡在本指南中的“安装 - 模块”命令
杰夫嗨,欢迎SO!请花点时间仔细研究以改进您的问题和格式:https://stackoverflow.com/help/how-to-ask – petezurich