Ошибка "Get-PowerCLIVersion : The term 'Get-PowerCLIVersion' is not recognized as the name of a cmdlet, function, script file, or operable program." при запуске VMware vSphere PowerCLI

Иногда при запуске VMware vSphere PowerCLI консоль загружается с ошибками:
Get-PowerCLIVersion : The term 'Get-PowerCLIVersion' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1:38 char:12 + $version = Get-PowerCLIVersion + ~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Get-PowerCLIVersion:String) [], CommandNotFoundExce ption + FullyQualifiedErrorId : CommandNotFoundException
Для решения попробуйте запустить Powershell под администратором и выполнить вот эти команды (они добавят путь к модулям PowerCLI в глобальныую переменную компьютера):
$CurrentValue = [Environment]::GetEnvironmentVariable("PSModulePath", "Machine") [Environment]::SetEnvironmentVariable("PSModulePath", $CurrentValue + ";C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules", "Machine")
- Просмотров: 2520