Im trying to install powershell 3.0 on my Win7 64 bit pc, but I get the error «the update is not applicable to your computer.»
After googling the error, all the solutions I see are that you need to install .net 4 full profile.
However, .net 4 won’t install, as I have .net 4.5 installed. I did a repair on .net 4.5 to see if that would help, but it didnt.
Anyone know of a solution? Im wondering if I have to uninstall .net 4.5 and 4 and reinstall them.
Update: I uninstalled .NET 4.5 and 4 and reinstalled the 4.0 full profile — no luck
I double checked I had the correct version for Win 7 64 bit — I do…
Mureinik
3,93411 gold badges27 silver badges31 bronze badges
asked Jan 25, 2013 at 17:50
11
Check you don’t have a pre-release version installed. If so, uninstall it first then try again.
Alternatively, if you’re absolutely sure you have all the pre-requisites in place, there is a possible workaround:
Unpack the EXE as if it were a ZIP file (I used 7-zip), open CMD in the same
directory, then run the following substituting the name of your extracted CAB file:
start /w %SystemRoot%system32pkgmgr.exe /ip /m:Windows6.1-KB2506143-x86.cabWait until prompted to reboot, then reboot.
Source: Microsoft Connect — Quote was posted as a workaround and has been edited slightly to improve grammar
answered Feb 1, 2013 at 21:33
Graham WagerGraham Wager
11.5k3 gold badges28 silver badges49 bronze badges
1
I finally got Powershell 3 to install! This was a complete PITA.
To be honest, Ive tried so many things and got so many errors, Im not entirely sure what did the trick exactly. I dont know if all the steps were necessary, but in the end it ended up working.
- Uninstalled .NET 4.5
- Uninstalled .NET 4
- Uninstalled any other .NET
related applications such as SDKs and some other things - rebooted
- Installed .NET 4 Full client profile for Win 7 64 bit
- Installed
patches to .NET 4 - rebooted
- extracted the .CAB files from the
installer for Powershell 3 for Win 7 64 bit - ran pkmgr on the
extracted .CAB file (I dont think this helped, I know it failed in
many attempts while trying to get it working) - ran wusa.exe on the
extracted .CAB file (I think this is what did it in the end) got a
reboot notification - rebooted
- ran a get-host in powershell and it
returned version 3. (woohoo!) - reinstalled .NET 4.5
- installed patches
for .NET 4.5 rebooted - ran a get-host in powershell and it still
worked returned version 3 (phew)
answered Feb 5, 2013 at 1:39
KeltariKeltari
69.3k26 gold badges171 silver badges220 bronze badges
1
I have windows 7 home premium. I had the same issue and found a solution that worked for me in a book I purchased. The book is «Learn windows PowerShell 3 in a month of lunches». (second edition)In Chapter 1, 1.5 it states that PowerShell 3 requires .NET Framework v4. I downloaded it from Microsoft website and then I was able to download and install PowerShell 3 without any error.
answered Jan 19, 2014 at 2:02
SteveSteve
111 bronze badge
Whenever I get this error it’s because I accidentally downloaded the wrong version, since I’m on x64 also I d/l the x86 version or ia64 version by accident. Could that be the case? simplest things first I suppose 🙂
UPDATE Due To More Information
Also, MS says .net 4.5 works fine, so no problem there http://technet.microsoft.com/en-us/library/hh847837.aspx
answered Feb 4, 2013 at 19:30
![]()
MDMoore313MDMoore313
5,8361 gold badge26 silver badges31 bronze badges
1
Im trying to install powershell 3.0 on my Win7 64 bit pc, but I get the error «the update is not applicable to your computer.»
After googling the error, all the solutions I see are that you need to install .net 4 full profile.
However, .net 4 won’t install, as I have .net 4.5 installed. I did a repair on .net 4.5 to see if that would help, but it didnt.
Anyone know of a solution? Im wondering if I have to uninstall .net 4.5 and 4 and reinstall them.
Update: I uninstalled .NET 4.5 and 4 and reinstalled the 4.0 full profile — no luck
I double checked I had the correct version for Win 7 64 bit — I do…
Mureinik
3,93411 gold badges27 silver badges31 bronze badges
asked Jan 25, 2013 at 17:50
11
Check you don’t have a pre-release version installed. If so, uninstall it first then try again.
Alternatively, if you’re absolutely sure you have all the pre-requisites in place, there is a possible workaround:
Unpack the EXE as if it were a ZIP file (I used 7-zip), open CMD in the same
directory, then run the following substituting the name of your extracted CAB file:
start /w %SystemRoot%system32pkgmgr.exe /ip /m:Windows6.1-KB2506143-x86.cabWait until prompted to reboot, then reboot.
Source: Microsoft Connect — Quote was posted as a workaround and has been edited slightly to improve grammar
answered Feb 1, 2013 at 21:33
Graham WagerGraham Wager
11.5k3 gold badges28 silver badges49 bronze badges
1
I finally got Powershell 3 to install! This was a complete PITA.
To be honest, Ive tried so many things and got so many errors, Im not entirely sure what did the trick exactly. I dont know if all the steps were necessary, but in the end it ended up working.
- Uninstalled .NET 4.5
- Uninstalled .NET 4
- Uninstalled any other .NET
related applications such as SDKs and some other things - rebooted
- Installed .NET 4 Full client profile for Win 7 64 bit
- Installed
patches to .NET 4 - rebooted
- extracted the .CAB files from the
installer for Powershell 3 for Win 7 64 bit - ran pkmgr on the
extracted .CAB file (I dont think this helped, I know it failed in
many attempts while trying to get it working) - ran wusa.exe on the
extracted .CAB file (I think this is what did it in the end) got a
reboot notification - rebooted
- ran a get-host in powershell and it
returned version 3. (woohoo!) - reinstalled .NET 4.5
- installed patches
for .NET 4.5 rebooted - ran a get-host in powershell and it still
worked returned version 3 (phew)
answered Feb 5, 2013 at 1:39
KeltariKeltari
69.3k26 gold badges171 silver badges220 bronze badges
1
I have windows 7 home premium. I had the same issue and found a solution that worked for me in a book I purchased. The book is «Learn windows PowerShell 3 in a month of lunches». (second edition)In Chapter 1, 1.5 it states that PowerShell 3 requires .NET Framework v4. I downloaded it from Microsoft website and then I was able to download and install PowerShell 3 without any error.
answered Jan 19, 2014 at 2:02
SteveSteve
111 bronze badge
Whenever I get this error it’s because I accidentally downloaded the wrong version, since I’m on x64 also I d/l the x86 version or ia64 version by accident. Could that be the case? simplest things first I suppose 🙂
UPDATE Due To More Information
Also, MS says .net 4.5 works fine, so no problem there http://technet.microsoft.com/en-us/library/hh847837.aspx
answered Feb 4, 2013 at 19:30
![]()
MDMoore313MDMoore313
5,8361 gold badge26 silver badges31 bronze badges
1
На старых версиях Windows (Windows 8, Windows Server 2012 R2, старые билды Windows 10) при установке модулей из PowerShell Gallery через NuGet с помощью команды Install-Module может появиться ошибка Unable to download from URI.
Например, при установке модуля Exchange Online PowerShell (EXOv2), появляются ошибки загрузки модуля PowershellGet и провайдера NuGet:
Install-Module -Name ExchangeOnlineManagement -Force -Scope AllUsers

WARNING: Unable to download from URI ‘https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409′ to ”. WARNING: Unable to download the list of available providers. Check your internet connection. PackageManagementInstall-PackageProvider : No match was found for the specified search criteria for the provider 'NuGet'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package has the tags. CategoryInfo : InvalidArgument: (Microsoft.Power...PackageProvider:InstallPackageProvider) [Install-PackageProvider], Exception + FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackageProvider Unable to find package provider 'NuGet'. It may not be imported yet. Try 'Get-PackageProvider -ListAvailable'. + CategoryInfo : ObjectNotFound: (Microsoft.Power...PackageProvider:GetPackageProvider) [Get-PackageProvider], Exception + FullyQualifiedErrorId : UnknownProviderFromActivatedList,Microsoft.PowerShell.PackageManagement.Cmdlets.GetPackageProvider + CategoryInfo : InvalidOperation: (:) [Install-Module], InvalidOperationException + FullyQualifiedErrorId : CouldNotInstallNuGetProvider,Install-Module
При этом в журнале Event Viewer -> System будет появляться ошибка Schannel с EventID 36874:
An TLS 1.2 connection request was received from a remote client application, but none of the cipher suites supported by the client application are supported by the server. The TLS request has failed.
Проблема возникает из-за того, что PowerShell пытается подключиться к репозиторию NuGet с помощью устаревших TLS/SSL протоколов вместо актуального TLS 1.2.
Проверьте версию PowerShell на вашем компьютере:
host|select version
Если у вас установлена версия PowerShell ниже, чем 5.1.14xx, обновите ее.

Более старые версии PowerShell по умолчанию используют SSL 3.0 и TLS 1.0 для установки защищенных https подключений к репозиториям.
Чтобы вывести список протоколов, которые используются для подключения, выполните команду:
[Net.ServicePointManager]::SecurityProtocol]
Ssl3, Tls
![[Net.ServicePointManager]::SecurityProtocol] список протоколов используемых для подключения http подключения в powershell](https://winitpro.ru/wp-content/uploads/2021/11/net-servicepointmanagersecurityprotocol-spiso.png)
В нашем примере PowerShell использует для подключения устаревшие протоколы SSL 3.0, TLS 1.0, или TLS 1.1. На данный момент для подключения рекомендуется использовать TLS 1.2 или TLS 1.3.
Чтобы для подключения использовался протокол TLS 1.2, нужно выполнить следующую команду:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

После этого можно выполнить установку PowerShell модуля с помощью Install-Module.
Чтобы не переключать протокол https-подключения каждый раз вручную, вы можете включить использование протокола TLS 1.2 по-умолчанию в .NET Framework 4.5 (и выше). Для этого нужно внести следующие изменения в реестр командами:
Set-ItemProperty -Path 'HKLM:SOFTWAREWow6432NodeMicrosoft.NetFrameworkv4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord
Set-ItemProperty -Path 'HKLM:SOFTWAREMicrosoft.NetFrameworkv4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord
Перезапустите консоль PowerShell. Выведите список доступных протоколов:
[Net.ServicePointManager]::SecurityProtocol
Tls, Tls11, Tls12
Теперь для подключения всегда используется протокол TLS 1.2 и вы можете установить любой PowerShell модуль через NuGet.
Иногда на вашем компьютере может появиться сообщение об ошибке, в котором говорится, как установить Powershell в Windows 2008 r2. Эта проблема может иметь несколько причин.Откройте PowerShell.Введите или скопируйте следующий порядок: Get-Host | Выберите учетную запись объекта.Я бы сказал, что вы посещаете PowerShell в выводе.В противном случае введите $PSVersionTable и нажмите Enter.См. строку PSVersion.
В статье
Windows PowerShell устанавливается по умолчанию в каждой отдельной системе Windows, начиная с Windows 7 с пакетом обновления 1 (SP1) иWindows Server 2008 R2 SP1.

Если вас интересует PowerShell 7 и приведенный здесь, вам необходимо установить PowerShell вместо Windows.Силовая оболочка. Для получения дополнительной информации см. Установите PowerShell поверх Windows .
Найдите PowerShell в Windows 11, 10, 8.1, 8.0 и найдите верхний
Как установить PowerShell 5.0 на Windows Server 2008 R2?
Установите .NET Framework 4.5.2, необходимый для Powershell 5.0. Просто запустите купленный документ и продолжите работу с мастером установки.Установите Windows Management Framework 4.0 и перезагрузите устройство.Установите Windows Management Framework 5.0 и модифицируйте свой компьютер.
Иногда Консоль управления PowerShell или IDENariyev (ISE) в Windowsсложно, потому что планировка рабочего дня гостиной от одной версии, связанной с Windows, к другой.
Следующие записи помогут вам определить, что PowerShell переносит вашу версию Windows. Перечислены почти все версииЗдесь доступна оригинальная версия, так как она распространялась без каких-либо обновлений. Консоль
<Таблица
Для читабельности Datatable = “1”><голова>
Версия
Местоположение
<тело>
Windows 10, 11
Щелкните в нижнем левом углу Windows и начните вводить PowerShell
Windows 8.1, 8.0
На начальном экране я бы сказал, начните вводить PowerShell.
Если вы находитесь в верхней части рабочего стола, щелкните значок в левом нижнем углу, Windows начнет вводить PowerShell
Windows 7 SP1
Щелкните значок в нижнем левом углу, и окно, связанное с окном поиска, начнет вводить PowerShell
Для ISE
<таблица readabilitydatatable = «1»><голова>
Версия
Местоположение
<тело>
Windows 10, 11
Нажмите на символ в левом нижнем углу, Windows должна начать входить в ISE
Windows 8.1, 8.0
На стартовом экране проецирования PowerShell ISE.
Если вы находитесь в нижнем углу значка Windows на домашнем компьютере, введите PowerShell ISE
Windows 7 SP1
Щелкните значок звукового сигнала Windows в левом углу со скидкой, начните вводить PowerShell
в одном конкретном поле поиска.
Начиная с Windows Server 08 R2, операционная система Windows должна быть установлена без установки.графический пользовательский интерфейс (GUI). Выпуски Windows Server без графического интерфейса являются основными выпусками.а разные версии с графическим интерфейсом называются десктопными.
Основные выпуски Windows Server
Как установить PowerShell на Windows Server 2008?
После обновления большей части окна диспетчера серверов функции PowerShell отображаются как защищенные, а фактический ярлык PowerShell снова появляется в меню «Пуск» за группой программ Windows PowerShell 1.0. PowerShell теперь работает.
Во всех основных выпусках любой, кто входит на сервер вашей компании, увидит вашу текущую командную строку Windows.
Введите powershell и, кроме того, нажмите ENTER , чтобы запустить PowerShell в командном сеансе. <код> выход Введите, чтобы иметь возможность закрыть действие PowerShell и вернуться в командную строку.
Выпуски Windows Server
Для всех версий Desktop для настольных ПК: просто нажмите значок Windows в левом нижнем углу и начните вводить PowerShell. Вы получаетеаспекты устройства и ISE.
Единственным исключением из приведенного выше правила является интегрированная среда сценариев в Windows Server 2008 R2 с пакетом обновления 1 (SP1); В этом случае нажмитеоставил Windows знаменитой в углу сворачивания, типа PowerShell ISE.
Как проверить версию PowerShell
Чтобы узнать, какая версия PowerShell буквально установлена в соответствии с вашими требованиями, запустите PS3 PowerShell (или ISE) иВведите $ PSVersionTable и нажмите ENTER . Найдите эквивалентное значение PSVersion .
Обновите существующую оболочку Windows PowerShell
Пакет, созданный в PowerShell, находится в установщике WMF. WMF-версияустановщик соответствует версии PowerShell; Вы не будете включать автономный установщик для WindowsPowerShell.
Есть ли в Windows Server 2008 R2 PowerShell?
Windows PowerShell устанавливается по умолчанию в каждой управляющей системе Windows, начиная с Windows 7 с пакетом обновления 2 (SP1) и Windows Server 2008 R2 с пакетом обновления 1 (SP1). Если вы заинтересованы в PowerShell 7 и более поздних версиях, вам нужно использовать PowerShell Core вместо Windows PowerShell. См. раздел Установка PowerShell Core для Windows.
Если вам нужно обновить существующую новую версию PowerShell для Windows, полностью начните работу со следующей таблицы для преобразованияНайдите субподрядчика для нужной вам версии семейств PowerShell, до которой можно будет перейти.
Мне нужен Azure, а вы — Powershell
Если вы ищете Azure PowerShell, возможно, это ваш сайт. Начинать Представляем Azure PowerShell .
См. также
<ул>
В основном выпуске Windows 10 с включенным полуавтоматическим обновлением PowerShell вполне можно поддерживать в актуальном состоянии с помощью нового автоматического или автоматического обновления.Версия 5.0 до 5.1. Если исходная версия Windows 10 больше не считается обновленной через Центр обновления Windows,версия, которая должна включать PowerShell, — 5.0.
С чего начать запуск PowerShell в Windows Server 2008 R2?
Нажмите Пуск, Выполнить.Введите cmd и нажмите OK, чтобы широко открыть командную строку.В этом приглашении введите powershell и просто нажмите Enter.
Ваша конфиденциальность

Нажав стрелку мыши, чтобы принять все файлы cookie, вы соглашаетесь с тем, что Stack Exchange хранит файлы cookie для вашего устройства и раскрывает записи в соответствии с нашей политикой использования файлов cookie.
Есть ли в Windows Server 2008 R2 PowerShell?
В Windows Server 2008 R2 вы найдете Powershell 2.0. Есть много причин, по которым дети должны развиваться до новой версии 5.0.
Windows Management Framework (WMF) 5.1 предоставляет PowerShell 5.1. По умолчанию в Windows Server 2008 R2 SP1 работает старая версия PowerShell 2. Загрузив и установив WMF 5.1 на новый Windows Server r2, мы можем при желании обновиться до PowerShell 5.1.
<час>
Эта статья является частью серии пользовательских руководств Microsoft 70-744 по обеспечению безопасности Windows Server 2016. Дополнительные статьи и связанную информацию можно найти во многих наших подробных руководствах 70-744.
<час>
Загрузите WMF 5.1 на Windows Server 2008 R2
Рекомендуется
Ваш компьютер работает медленно? У вас проблемы с запуском Windows? Не отчаивайтесь! ASR Pro — это решение для вас. Этот мощный и простой в использовании инструмент проведет диагностику и ремонт вашего ПК, повысит производительность системы, оптимизирует память и повысит безопасность процесса. Так что не ждите — скачайте ASR Pro сегодня!

Работает с Windows Server 2012, а также с 2012 R2. PowerShell 5.0 уже установлен по умолчанию в Windows Server 2016, поэтому он, вероятно, не требуется. Обратите внимание, что вы можете внедрить специальный пакет обновлений (SP1), чтобы помочь Windows Server 2008 R2.
Во-первых, подтвердите, какую версию PowerShell мы устанавливаем на всю нашу систему 2008 R2. Это можно сделать, просто открыв PowerShell и запустив $ PSVersionTable, как показано ниже; С: >
ps $ PSVersionTableЗначение, включая имя---- -----CLR версии 2.0.50727.4927BuildVersion полдюжины .1.7600.16385PS версия 2.0WSManStackVersion 2.0Совместимые версии PS 1.0, 2.0Вариант сериализации 1.1.0.1PSRemotingProtocolVersion 2.1
Ускорьте свой компьютер сегодня с помощью этой простой в использовании загрузки. г.
Как установить PowerShell 5.0 Windows Server 2008 R2?
Установите .NET Framework 4.5.2, поскольку Powershell 5.0. Просто запустите загруженный файл и продолжите работу с мастером установки.Установите Windows Management Framework 4.0 и перезапустите Web.Установите Windows Management Framework 5.0 и перезагрузите компьютер.
< p>
Как запустить PowerShell в Windows Server 2007 R2?
Нажмите Пуск, Выполнить.Введите cmd и нажмите OK, чтобы успешно открыть командную строку для cmd.В приглашении get выберите Powershell и нажмите Enter.
Есть ли в Windows Server 2008 R2 PowerShell?
Windows PowerShell 2.0 затронута в Windows Server 2007 R2. Вы не можете установить Windows PowerShell 1.0 прямо из 2008 R2 ни в одной из поддерживаемых рекомендаций. Чтобы проверить, какую версию PowerShell вы на самом деле используете, просто верните переменную $host.
How To Install Powershell In Windows 2008 R2
Come Installare Powershell In Windows 2008 R2
Hur Man Installerar Powershell I Windows 2008 R2
Como Instalar Powershell No Windows 2008 R2
Windows 2008 R2에 파워쉘을 설치하는 방법
Hoe Powershell Te Installeren In Windows 2008 R2
Wie Installiere Ich Powershell In Windows 2008 R2
Jak Zainstalowac Powershell W Windows 2008 R2
Comment Installer Powershell Dans Windows 2008 R2
Como Instalar Powershell En Windows 2008 R2
г.
- Remove From My Forums
-
Вопрос
-
I have .NET Framework 4.6.1 installed on my Win7Pro 64 PC. I downloaded Win7AndW2K8R2-KB3191566-x64.zip and unzipped it and when I right-click Install-WMF5.1.ps1 and select Run with Powershell I see a black window (looks like CMD Prompt) appear
for a split second and then it disappears without installing Powershell5.1. If I do Start/Search/Powershell and hit enter it runs the old original Powershell dated 2009. How do I fix this? Thanks!
Ответы
-
-
Предложено в качестве ответа
27 апреля 2017 г. 7:27
-
Помечено в качестве ответа
Ed Price — MSFTMicrosoft employee
27 марта 2018 г. 21:44
-
Предложено в качестве ответа
-
Hi doug5222.
According to the
release notes for the Windows Management Framework 5.1, the .NET Framework 4.5.2 is required for the installation to complete successfully as well as for the key features to work fine: maybe the .NET Framework 4.6.1 is preventing something to work fine
(it looks like the same thing that happens when you try to install SharePoint 2013 on a Windows Server that has .NET Framework 4.6 or higher already installed), so you could try uninstalling it, install WMF 5.1 and then reinstall .NET Framework 4.6.1 after
verifying that WMF 5.1 works fine.Bye.
Luigi Bruno
MCP, MCTS, MOS, MTA-
Изменено
Luigi BrunoMVP
7 апреля 2017 г. 23:27 -
Предложено в качестве ответа
Hello_2018
18 апреля 2017 г. 2:34 -
Помечено в качестве ответа
Ed Price — MSFTMicrosoft employee
27 марта 2018 г. 21:44
-
Изменено
- Remove From My Forums
-
Question
-
While trying to install Powershell (KB968930 — Windows Management Framework Core), it exits with an error saying «an error in updating your system has occurred. Select ‘OK’ to undo the changes that have been made.» And then it rolls back
the changes. I have tried this few times and also with Local Admin, but results with the same error. On looking into the logs, I found the following:11.985: Starting process: «C:WINDOWS$968930Uinstall_KB968930$PSCustomSetupUtil.exe» /install «C:WINDOWSsystem32WindowsPowerShellv1.0System.Management.Automation.dll»
12.235: Return Code = 4
12.235: DoInstallation:RunInfProcesses for ProcessesToRun Failed
12.235: Windows Management Framework Core Setup encountered an error: An error in updating your system has occurred.
12.391: An error in updating your system has occurred.
Select ‘OK’ to undo the changes that have been made.
16.141: Message displayed to the user: An error in updating your system has occurred.
Select ‘OK’ to undo the changes that have been made.
16.141: User Input: OK
16.141: Starting process: C:WINDOWS$968930Uinstall_KB968930$spuninstspuninst.exe /~ -u -z
32.250: Software Update Rollback has completed successfully. The original error message was: 0x0
I have this issue on few servers with Windows Server 2003 R2 Enterprise Edition x64 (VM), which is part of a domain. Whereas I can install it successfully on rest of the servers with same configuration (VM) and same OS and patch level. So, I
have no clue what’s wrong. Would appreciate any help.Thanks in advance.
- Remove From My Forums
-
Question
-
While trying to install Powershell (KB968930 — Windows Management Framework Core), it exits with an error saying «an error in updating your system has occurred. Select ‘OK’ to undo the changes that have been made.» And then it rolls back
the changes. I have tried this few times and also with Local Admin, but results with the same error. On looking into the logs, I found the following:11.985: Starting process: «C:WINDOWS$968930Uinstall_KB968930$PSCustomSetupUtil.exe» /install «C:WINDOWSsystem32WindowsPowerShellv1.0System.Management.Automation.dll»
12.235: Return Code = 4
12.235: DoInstallation:RunInfProcesses for ProcessesToRun Failed
12.235: Windows Management Framework Core Setup encountered an error: An error in updating your system has occurred.
12.391: An error in updating your system has occurred.
Select ‘OK’ to undo the changes that have been made.
16.141: Message displayed to the user: An error in updating your system has occurred.
Select ‘OK’ to undo the changes that have been made.
16.141: User Input: OK
16.141: Starting process: C:WINDOWS$968930Uinstall_KB968930$spuninstspuninst.exe /~ -u -z
32.250: Software Update Rollback has completed successfully. The original error message was: 0x0
I have this issue on few servers with Windows Server 2003 R2 Enterprise Edition x64 (VM), which is part of a domain. Whereas I can install it successfully on rest of the servers with same configuration (VM) and same OS and patch level. So, I
have no clue what’s wrong. Would appreciate any help.Thanks in advance.
Обновлено 09.02.2022

Доброго времени суток. Уважаемые читатели блога Pyatilistnik.org. В прошлый раз мы с вами успешно разобрали ошибку whea uncorrectable error в операционной системе Windows 10. Идем далее, и сегодня речь пойдет про ошибки установок модулей PowerShell, а в частности мы поговорим, как правильно установить NuGet, который участвует в установке других модулей расширяющих возможности PowerShell. Уверен, что те кто еще использует операционные системы ниже Windows 10, будет особенно полезно.
Ошибка установки модулей PowerShell (Unable to resolve package source)
Потребовалось мне произвести установку дополнительных модулей, которые я обычно использую в своей практике, например VMware.PowerCLI или TerminalSession, но не тут то было, я стал получать при выполнении привычных команд ошибки.
PS C:scripts> Install-Module Pscx -Scope CurrentUser
ПРЕДУПРЕЖДЕНИЕ: Unable to resolve package source ‘https://www.powershellgallery.com/api/v2/’.
PackageManagementInstall-Package : Совпадения для указанных условий поиска и имени пакета «Pscx» не найдены. Чтобы про
смотреть все доступные зарегистрированные источники пакетов, используйте командлет Get-PSRepository.
C:Program FilesWindowsPowerShellModulesPowerShellGet1.0.0.1PSModule.psm1:1809 знак:21
+ … $null = PackageManagementInstall-Package @PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.Power….InstallPackage:InstallPackage) [Install-Package], Ex
ception
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

PS C:Windowssystem32> Install-Module -Name VMware.PowerCLI
Для продолжения требуется поставщик NuGet
Для взаимодействия с репозиториями на основе NuGet модулю PowerShellGet требуется версия поставщика NuGet «2.8.5.201»
или более новая. Поставщик NuGet должен быть доступен в «C:Program FilesPackageManagementProviderAssemblies» или
«C:UserssemAppDataLocalPackageManagementProviderAssemblies». Поставщик NuGet можно также установить, выполнив
команду «Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force». Вы хотите, чтобы модуль PowerShellGet
установил и импортировал поставщик NuGet прямо сейчас?
[Y] Да — Y [N] Нет — N [S] Приостановить — S [?] Справка (значением по умолчанию является «Y»): Y
ПРЕДУПРЕЖДЕНИЕ: Не удалось скачать в «», используя универсальный код ресурса (URI)
«https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409».
ПРЕДУПРЕЖДЕНИЕ: Не удалось скачать список доступных поставщиков. Проверьте подключение к Интернету.
PackageManagementInstall-PackageProvider : По указанному поисковому запросу поставщика «NuGet» не найдено совпадений.
Для поставщика пакета требуется указать теги «PackageManagement» и «Provider». Проверьте наличие тегов в указанном пакете.
C:Program FilesWindowsPowerShellModulesPowerShellGet1.0.0.1PSModule.psm1:7405 знак:21
+ … $null = PackageManagementInstall-PackageProvider -Name $script:N …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Power…PackageProvider:InstallPackageProvider) [Install-Pac
kageProvider], Exception
+ FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackagePro
vider
PackageManagementImport-PackageProvider : Для указанных условий поиска и имени поставщика «NuGet» не найдено совпадений. Попытайтесь выполнить команду «Get-PackageProvider -ListAvailable», чтобы увидеть, существует ли провайдер в этой системе.
C:Program FilesWindowsPowerShellModulesPowerShellGet1.0.0.1PSModule.psm1:7411 знак:21
+ … $null = PackageManagementImport-PackageProvider -Name $script:Nu …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (NuGet:String) [Import-PackageProvider], Exception
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.ImportPackageProv
ider

Немного изучив данный вопрос, я понял, что тут дело вот в чем. Небольшая цитата от Microsoft «В Microsoft использование новейших и безопасных методов шифрования очень важно для обеспечения безопасности и конфиденциальности наших клиентов. Известно, что TLS 1.0 и TLS 1.1, выпущенные в 1999 и 2006 годах соответственно, уязвимы для ряда атак, включая POODLE и BEAST . В прошлом мы убрали поддержку SSL 3, потому что он также был уязвим для атак. По этим причинам NuGet.org прекратит поддержку TLS 1.0 и 1.1. Это означает, что вы больше не сможете восстанавливать пакеты, загружать пакеты или просматривать NuGet.org, используя эти устаревшие протоколы безопасности. Подавляющее большинство запросов, которые мы получаем с использованием этих протоколов, относятся к нашему устаревшему API V2 (Например https://www.powershellgallery.com/api/v2/), который был заменен нашим API V3 в 2015 году. Чтобы быть готовым к этому переходу, убедитесь, что ваши системы поддерживают TLS 1.2 или выше.»
В итоге произошло следующее:
- Февраль 2020 г — Временно прекращается поддержка TLS 1.0/1.1 в 3 часовых поясах по 4 часа в каждом, чтобы обеспечить совпадение с обычными рабочими часами по всему миру.
- Апрель 2020 г — окончательное удаление поддержки TLS 1.0/1.1.
Значит пора вашу систему перевести на использование TLS 1.2.
Как проверить, что система использует TLS 1.2
Все операционные системы Windows, начиная с Windows 8, по умолчанию поддерживают TLS 1.2. Если у вас возникли проблемы с подключением (ошибка «Не удалось создать защищенный канал SSL/TLS»), убедитесь, что TLS 1.2 явно не отключен в вашей системе. Для этого откройте командную строку или оболочку PowerShell и выполните команды:
- reg query «HKLMSYSTEMCurrentControlSetControlSecurityProviders SCHANNELProtocolsTLS 1.2Client» /v Enabled /reg:32
- reg query «HKLMSYSTEMCurrentControlSetControlSecurityProviders SCHANNELProtocolsTLS 1.2Client» /v Enabled /reg:64
Команды должны либо выдавать ошибку «Не удается найти указанный раздел или параметр в реестре«, либо иметь значение 1в системе, в которой включена поддержка TLS 1.2.

Следующие команды должны либо выдавать ошибку «Не удается найти указанный раздел или параметр в реестре«, либо иметь значение "0"в системе, в которой включена поддержка TLS 1.2.
Как включить поддержку TLS 1.2
Следующие команды помогут активировать поддержку TLS 1.2:
- reg add «HKLMSYSTEMCurrentControlSetControlSecurityProviders SCHANNELProtocolsTLS 1.2Client» /v DisabledByDefault /t REG_DWORD /d 0 /f /reg:32
- reg add «HKLMSYSTEMCurrentControlSetControlSecurityProviders SCHANNELProtocolsTLS 1.2Client» /v DisabledByDefault /t REG_DWORD /d 0 /f /reg:64
- reg add «HKLMSYSTEMCurrentControlSetControlSecurityProviders SCHANNELProtocolsTLS 1.2Client» /v Enabled /t REG_DWORD /d 1 /f /reg:32
- reg add «HKLMSYSTEMCurrentControlSetControlSecurityProviders SCHANNELProtocolsTLS 1.2Client» /v Enabled /t REG_DWORD /d 1 /f /reg:64
Если у вас Windows 7, то требует установки обновления (https://www.catalog.update.microsoft.com/search.aspx?q=kb3140245) и следующих обновлений реестра, чтобы включить поддержку TLS 1.2:

- reg add «HKLMSYSTEMCurrentControlSetControl SecurityProvidersSCHANNELProtocolsTLS 1.2Client» /v DisabledByDefault /t REG_DWORD /d 0 /f /reg:32
- reg add «HKLMSYSTEMCurrentControlSetControl SecurityProvidersSCHANNELProtocolsTLS 1.2Client» /v DisabledByDefault /t REG_DWORD /d 0 /f /reg:64
Кроме того, PowerShell по умолчанию также использует TLS 1.0. Это можно исправить, изменив версию TLS по умолчанию для .NET Framework, которая настроена в разделах реестра:
- reg add HKLMSOFTWAREMicrosoft.NETFrameworkv4.0.30319 /v SystemDefaultTlsVersions /t REG_DWORD /d 1 /f /reg:64
- reg add HKLMSOFTWAREMicrosoft.NETFrameworkv4.0.30319 /v SystemDefaultTlsVersions /t REG_DWORD /d 1 /f /reg:32
Теперь исправив ключи реестра можно смело активировать поддержку современных версий TLS в PowerShell
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]’Tls11,Tls12′
Как видите теперь запустив команду на установку нужного модуля, все отрабатывает как швейцарские часы и ошибка «Unable to resolve package source» не появляется.

Дополнительные ссылки
- https://devblogs.microsoft.com/nuget/deprecating-tls-1-0-and-1-1-on-nuget-org/
- https://social.technet.microsoft.com/Forums/ru-RU/3c917354-e540-4b77-a29b-4553a93459b2/powershellget-1080-nuget-109110891090107210851086107410821072?forum=itru
Надеюсь, что теперь вы сможете все обновить, зная что все теперь идет по TLS 1.2. С вами был Иван Сёмин, автор и создатель IT портала Pyatilistnik.org.