Обновить версию powershell windows 7

В этой статье мы рассмотрим, как обновить версию Windows PowerShell до актуальной 5.1 и установить (обновить) PowerShell Core 7.3. В предыдущей статье мы рассказывали, что на данный момент есть две ветки PowerShell:

  • старая версия Windows PowerShell (максимальная версия 5.1, которая более не развивается);
  • новая платформа PowerShell Core (сейчас доступна версия 7.3).

Несмотря на то, что нумерация версий PowerShell продолжается с 5.1 (6.0, 6.1, 7.0 и т.д.), это две разные платформы. Соответственно мы отдельно рассмотрим как обновить Windows PowerShell и PowerShell Core.

PowerShell Core 7.x максимально совместима с Windows PowerShell. Это означает, что вы можете запускать свои старые скрипты и командлеты в PowerShell Core.

Содержание:

  • Обновление Windows PowerShell до 5.1
  • Установка/обновление PowerShell Core 7.x
  • Установка/обновление PowerShell Core на удаленных комьютерах
  • Обновление PowerShell через Windows Update или WSUS

Обновление Windows PowerShell до 5.1

Во всех версиях, начиная с Windows 10 и Windows Server 2016, Windows PowerShell 5.1 уже установлен по-умолчанию.

В предыдущих версиях (Windows 7/8.1 и Windows 2008 R2/2012) обновление до PowerShell 5.1 нужно выполнять вручную. Например, в Windows Server 2012 R2 (Windows 8.1) установлен PowerShell 4.0.

Попробуем обновить версию Windows PowerShell в Windows Server 2012 R2 до версии 5.1.

Сначала проверьте текущую версию PowerShell (на скриншоте видно, что это PowerShell 4.0):

$PSVersionTable.PSVersion

$PSVersionTable.PSVersion версия powershell

Чтобы обновить вашу версию PowerShell до 5.1, нужно установить пакет Windows Management Framework (WMF) 5.1, который в свою очередь требует наличия .NET Framework 4.5.2 (или более поздней версии). Убедитесь, что у вас установлена версий .NET 4.5.2 или выше командой:

(Get-ItemProperty ‘HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full’ -Name Release).Release

проверить версию .net

В моем случае код 378675 говорит о том, что установлена версия .NET 4.5.1. Поэтому мне нужно скачать и установить более новую .NET Framework 4.8 (ссылка на офлайн установщик https://go.microsoft.com/fwlink/?linkid=2088631 —
ndp48-x86-x64-allos-enu.exe
).

Установите .NET 4.8 (потребуется перезагрузка).

офлайн установка .NET Framework 4.8

Если установить WMF 5.1, но не установить .NET 4.5.2 (или более новый), часть функций PowerShell не будет работать.

Скачайте WMF 5.1 для Windows Server 2012 R2 —
Win8.1AndW2K12R2-KB3191564-x64.msu
(https://go.microsoft.com/fwlink/?linkid=839516).

Установите MSU файл Windows Management Framework 5.1.

установка Windows Management Framework 5.1 kb3191564

После перезагрузки сервера, запустите консоль powershell.exe и убедитесь, что версия была обновлена до PowerShell 5.1.

обновление версии windows powershell до 5.1 в windows server 2012 r2

Если у вас остались снятые с поддержки Windows Server 2008 R2 и Windows 7, вы можете обновить на них версию PowerShell с 2.0 до 5.1 аналогичным способом. Сначала устанавливается .Net Framework 4.5.2 (или выше) и затем WMF 5.1 (ссылки загрузки будут другими, чем для Windows Server 2012 R2).

Установка/обновление PowerShell Core 7.x

PowerShell Core является кроссплатформенной и находится в стадии активной разработки (в отличии от Windows PoweShell 5.1). По сути, PowerShell Core это новая платформа, которая устанавливается в операционной системе вместе с классическим Windows PowerShell. Т.е. нельзя обновить PowerShell 5.1 до PowerShell Core 7.1. PowerShell 7 устанавливается на компьютере отдельно от Windows PowerShell 5.1 (side by side).

На данный момент доступны версии PowerShell Core 6.x и 7.x. Рекомендуется всегда устанавливать последнюю версиях PowerShell (сейчас это 7.3), если вам не требуется особая совместимость с legacy скриптами.

Вы можете обновить (установить) версию PowerShell Core в Windows 10 и 11 несколькими способами:

  • С помощью MSI установщика PowerShell Core, который можно скачать на GitHub
  • С помощью менеджера пакетов WinGet
  • С помощью магазина приложений Microsoft

Далее мы рассмотрим все эти способы на примере обновления PowerShell Core до 7.3 в Windows 10 22H2

Обновить PowerShell Core с помощью MSI установщика

Если вы хотите установить PowerShell Core с помощью MSI пакета, перейдите на старицу проекта https://github.com/PowerShell/PowerShell и скачайте установочный пакет для вашей версии ОС. На момент написания статьи последняя версия v7.3.3 Release of PowerShell от 24 февраля 2023 (например, PowerShell-7.3.3-win-x64.msi или PowerShell-7.3.3-win-x86.msi). Для продуктивной среды используйте Stable или LTS релизы.

скачать MSI установщик PowerShell для windows

Скачайте msi файл и установите его.

Доступны следующие опции установки:

  • Add PowerShell to Path Environment Variable
  • Register Windows Event Logging Manifest (для событий PowerShell будет создан отдельный журнал Event Viewer
    %SystemRoot%\System32\Winevt\Logs\PowerShellCore%4Operational.evtx
    )
  • Enable PowerShell Remoting (включает и настраивает WinRM для PowerShell Remoting)
  • Add ‘Open here’ context menu to Explorer
  • Add ‘Run with PowerShell 7’ context menu for PowerShell files

параметры установки powershell из msi пакета

Далее вы можете включить автоматическое обновление PowerShell Core через WIndows Update/WSUS (рассмотрено ниже).

разрешить автоматическое обновление powershell core 7.2+

Для установки PowerShell Core из MSI пакета средствами SCCM/MDT/скриптами в тихом режиме можно использовать команду установки со следующими параметрами:

  • ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL
  • ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL
  • ENABLE_PSREMOTING
  • REGISTER_MANIFEST
  • ADD_PATH
  • DISABLE_TELEMETRY
  • USE_MU – использовать Microsoft Update для получения обновлений PSCore
  • ENABLE_MU – разрешить обновление PowerShell Core через Windows Update

Например, команда установки может выглядеть так:

msiexec.exe /package PowerShell-7.3.3-win-x64.msi /quiet ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 ENABLE_PSREMOTING=1 REGISTER_MANIFEST=1 ADD_PATH=1 ENABLE_MU=1 ADD_PATH=1

Вы можете обновить PowerShell непосредственно из консоли. Чтобы установить или обновиться до последней версии PoSh Core, выполните команду:

iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI"

Данная команда загружает установочный MSI файл PowerShell 7.3 с GitHub и запускает установку через MSI Installer.

install-powershell.ps1 скрипт обновления powershell

После окончания установки открывается окно PowerShell Core (pwsh.exe), проверьте версию PowerShell и убедитесь, что теперь это PoSh 7.3.3.

проверить что powershell core обновлен в windows

Используем менеджер пакетов WinGet для установки/обновления PowerShell Core

Если у вас установлен пакетный менеджер WinGet, вы можете установить или обновить версию PowerShell до актуальной командой:

winget install --id Microsoft.Powershell --source winget

Либо можно установить конкретную версию PowerShell Core:

winget install --id=Microsoft.PowerShell -v "7.1.2" -e

При использовании менеджера пакетов Chocolatey, используйте команды (для 5.1):

choco install powershell -y
choco upgrade powershell -y

Для обновления PowerShell 7.x:

choco upgrade pwsh -y

Обратите внимание на каталоги различных версий PowerShell:

  • Windows PowerShell 5.1:
    $env:WINDIR\System32\WindowsPowerShell\v1.0
  • PowerShell Core 6.x:
    $env:ProgramFiles\PowerShell\6
  • PowerShell 7.x:
    $env:ProgramFiles\PowerShell\7

Если на компьютере был установлен PowerShell 6.x, то при установке PowerShell 7.3 каталог
$env:ProgramFiles\PowerShell\6
автоматически удаляется.

Обратите внимание, что имя исполняемого файла среды PowerShell изменился. Теперь это
c:\Program Files\PowerShell\7\pwsh.exe
. У него собственная иконка в меню Start.

  • Для запуска Windows PowerShell, основанного на .NET Framework используется команда
    powershell.exe
  • Для запуска PowerShell Core, основанного на .NET Core, нужно использовать команду
    pwsh.exe

powershell core 7 в windows 10

Т.е. теперь на этом компьютере есть две версии: Windows PowerShell 5.1 и PowerShell Core 7.3.

две версии powershell на компьютере core и desktop

Чтобы узнать версию PowerShell можно проверять версию файла pwsh.exe:

(Get-Command 'C:\Program Files\PowerShell\7\pwsh.exe').Version

Так можно проверить версию файла на удаленном компьютере:

Invoke-Command -Computername computer1 -Scriptblock {(Get-Command 'C:\Program Files\PowerShell\7\pwsh.exe').Version}

Чтобы запустить предыдущую версию PowerShell (например 4), используйте команду:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Version 4

Установка PowerShell Core через Microsoft Store

В Windows 10 и 11вы можете установить или обновить PowerShell через магазин приложений Microsoft Store. Приложение PowerShell можно найти в магазине вручную, или воспользуйтесь этой ссылкой.

Также вы можете установить магазинную версию PowerShell через WinGet:

winget search powershell --source msstore
winget install --id 9MZ1SNWT0N5D

Преимущество установки PowerShell Core через Microsoft Store в том, что магазин прилжений будет автоматически контролировать установленную версию PowerShell и автоматически устанавливать обновления по мере их появления.

Вы можете проверить, установлена ли у вас Store версия PowerShell Coreс помощью команды:

Get-AppPackage Microsoft.PowerShell

В этом примере пакет Microsoft.PowerShell_7.3.3.0_x64__8wekyb3d8bbwe установлен.

appx приложение Microsoft.PowerShell_7.3.3.0_x64__8wekyb3d8bbwe в microsoft store

Но есть и недостатки, связанные с тем, что такой PowerShell будет запускаться в песочнице.

ustanovkaобновление powershell core в windows 10 через microsoft store

Установка/обновление PowerShell Core на удаленных комьютерах

Рассмотрим два сценария установки или обновления версии PowerShell Core на множестве компьютерах.

Обновление PowerShell Core с помощью GPO

В домене Active Directory вы можете централизованно установить и обновить PowerShell Core с помощью групповой политики. Воспользуйтесь возможностями установки программ с помощью MSI пакетов в GPO.

  1. Скачайте установочный MSI файл PowerShell и скопируйте его в каталог SYSVOL на контроллере домена;
  2. Откройте консоль управления доменными GPO (
    gpmc.msc
    ), создайте новую GPO и назначьте ее на OU с компьютерами и серверами;
  3. Перейдите в раздел GPO Computer Configuration –> Software Settings, создайте новый пакет и укажите для него путь к установочному MSI файлу PowerShell в SYSVOL; обновление powershell в домене через gpo

    Для более тонкого нацеливания политики на клиентов можно использовать WMI фильтры GPO.

  4. Для обновления групповых политик установки ПО нужно перезагрузить компьютеры. Во время загрузки на всех компьютерах будет установлена новая версия PowerShell.

Обновление PowerShell на удаленных компьютерах из командной строки

Вы можете обновлять PowerShell на удаленных компьютерах из командной строки.

  • Первый способ позволяет удаленно обновить PowerShell на компьютере с помощью MSI установщика в сетевом каталоге:
    Invoke-Command -ComputerName dc01 -ScriptBlock {Start-Process msiexec.exe -ArgumentList '/package "\\srv1\share\PowerShell-7.3.3-win-x64.msi" /quiet ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 ENABLE_PSREMOTING=1 REGISTER_MANIFEST=1' -Wait}
  • Следующий скрипт позволит выбрать все активные компьютеры с Windows 10 из домена Active Directory и запустить на каждом из них загрузку и установку PowerShell Core:
    $creds = $(Get-Credential)
    $computers = Get-ADComputer -Filter 'operatingsystem -like "*Windows 10*" -and enabled -eq "true"'
    ForEach ($computer in $computers) {
    Invoke-Command -ComputerName $computer -Credential $creds {iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI -Quiet"}
    }

Будьте внимательными при использовании команд PowerShell Remoting при подключении к удаленным компьютерам (Enter-PSSession, Invoke-Command). Если вам нужно подключиться к точке управления PowerShell 7 нужно использовать команду:

Enter-PSSession -ComputerName dc01 -ConfigurationName "powershell.7"

Иначе вы подключитесь к точке PowerShell Remoting 5.1.

Обновление PowerShell в Linux дистрибутивах чаще проще всего выполняется через нативный менеджер пакетов.

Обновление PowerShell через Windows Update или WSUS

До версии PowerShell Core 7.2 не поддерживалось автоматическое обновление pwsh.exe. После выхода нового релиза в консоли появилось уведомление:

A new PowerShell stable release is available. Upgrade now, or check out the release page at: https://aka.ms/PowerShell-Release?tag=v7.1.3

Начиная с версии 7.2, PowerShell Core поддерживает автоматическое обновление через Windows Update ( Microsoft Update, Windows Update for Business, внутренний WSUS сервер или SCCM). Для этого при установке MSI пакета нужно включить соответствующие опции.

Проверьте, что в панели управления Settings -> Update and Security -> Windows Update -> Advanced Options теперь включена опция Receive updates for other Microsoft products when you update Windows.

Разрешить Windows получаить обнволения с Windows Update для других продуктов

Теперь, когда вы нажимаете кнопку Check for Updates или запускаете сканирование обновлений через модуль PSWindowsUpdate, вы также будете получать обновления для PowerShell Core.

проверить новые обновления в windows

  • erge

Всех приветствую! Ситуация такова: имеется Windows 7 SP1 x64 Ultimate
Захотелось обновить имееющийся в данной оси по дефолту павершелл 2.0 на один из последних — 5.0 или 5.1
(Хотя есть уже вроде и 6.0 и 7.0 но в данном случае речь не об этом)
Вообщем имеется у мелкософт на сайте инструкция по сей операции
https://docs.microsoft.com/ru-ru/powershell/script…

Установите универсальную среду выполнения C в версиях Windows, предшествующих Windows 10. Ее можно скачать самостоятельно или через Центр обновления Windows. Поддерживаемые системы, где установлены все исправления (включая дополнительные пакеты), уже содержат ее.
Установите Windows Management Framework (WMF) 4.0 или более поздней версии в Windows 7 и Windows Server 2008 R2. Подробные сведения о WMF см. в статье с обзором WMF.

среда выполнения C — https://www.microsoft.com/download/details.aspx?id…
WMF — https://docs.microsoft.com/ru-ru/powershell/script…
https://docs.microsoft.com/ru-ru/powershell/script…
— Вообщем скачал среду выполнения С, установилась без проблем
— скачал WMF 4.0, захожу в папку — там сам пакет обновления и скрипт для его установки — Install-WMFxx.ps1
открываю powershell включаю запуск подписанных скриптов — set-executionpolicy remotesigned
запускаю для скрипт для установки Install-WMFxx.ps1, прохожу стандартные шаги выполнения установки обновления — принимаю EULA и т.д. идет установка и в итоге выдается —

Следующие обновления не установлены:
Обновление для ОС Windows (KB3191566)

То же самое и с WMF 5.0 и WMF 5.1, почему не получается установить? Вроде же все правильно делаю по инструкции, как можно узнать причину почему этот пакет не хочет устанавливаться?


  • Вопрос задан

  • 17277 просмотров

вам нужно определиться какой повершелл вам нужен.
всем привычный повершелл закончился на версии 5.1.
дальше (6.х+) пошел powershell core (разница).
чтобы установить обычный, не кор, повершелл 5.1 просто запустите .ps1 файл, распаковав архив Win7AndW2K8R2-KB3191566-x64.ZIP отсюда https://docs.microsoft.com/ru-ru/powershell/script… займет какое-то время и попросит перезагрузиться.

на форумах чаще всего проблемы с установкой именно этого обновления решаются переустановкой ОС. =(

П.С. можно еще попробовать обновить .NET Framework

А всё получилось! Забыл просто что иногда некоторые обновления в винде не хотят обновляться если нет каких либо предыдущих обнов, выполнил установку всех имевшихся обнов через центр обновления и павершелл обновился!

Если у вас уже есть .NET 4.0, то можете попробовать так:
dotnet tool install --global PowerShell (взято из вышеупомянутой статьи, но это установка Powershell core)
А вообще проблема также может быть в том, что Microsoft обещает прекратить поддержку Windows 7 в 2020-ом году. Не уверен, что они это таки сделают, но юзеров на десятку им переводить надо. Если не помогает, могу предложить только обновиться до десятки. Скачать можно бесплатно и не парится с активацией, кроме того никто не отменял тот же KMS. Кстати, а зачем вам вообще понадобился Powershell 5.0/5.1?

Пригласить эксперта


  • Показать ещё
    Загружается…

10 окт. 2023, в 11:16

25000 руб./за проект

10 окт. 2023, в 11:14

1000 руб./в час

10 окт. 2023, в 10:48

1500 руб./за проект

Минуточку внимания

In this tutorial, you will learn how to update PowerShell on Windows to the latest version. I’ll also show you how to upgrade PowerShell version 5.1 to PowerShell Core 7.

If you are new to PowerShell it can be confusing to know that there are two different versions. I’ll explain the difference and which version you should be using.

I reference the two PowerShell versions as the original PowerShell (old) and PowerShell Core (new).

Contents:

  • PowerShell 5.1 vs PowerShell Core 7.1
  • Update PowerShell to Version 5.1
  • How to Upgrade to PowerShell Core 7
  • Update PowerShell on Multiple Computers (GPO)
  • Frequently Asked Questions

PowerShell 5.1 vs PowerShell Core 7

Microsoft has created a mess in my opinion.

Microsoft released PowerShell for Windows in 2006 and it has become very popular with the Windows community. In 2016 Microsoft released a new PowerShell version that is open source and cross-platform, this version is called “PowerShell Core”. PowerShell was originally created as a scripting language for Microsoft systems. Then Microsoft makes it cross-platform because Linux doesn’t have a scripting language? Anyways, that is beyond the scope of this article.

Here are the key differences:

  • The original PowerShell is no longer being developed. Its latest version is PowerShell 5.1.
  • PowerShell 5.1 is the default version installed with Windows 10 1607 and up, Windows 11, Server 2016 and later versions.
  • The original Powershell can only be used with Windows operating systems.
  • PowerShell Core is open source and can be installed on various operating systems (Linux, osx, etc.)
  • PowerShell Core is installed separately from PowerShell 5.1 (side by side)
  • PowerShell Core uses .Net core runtime environment
  • You cannot use PowerShell ISE with PowerShell Core (insert sad emoji)
  • Visual Studio Code is recommended for development with PowerShell Core.

Here are the steps for updating to the latest original PowerShell version 5.1. In this example, I have a 2012 Windows Server that comes with PowerShell version 4.0.

You can quickly check your PowerShell version with the command below:

$PSVersionTable.PSVersion

In the screenshot above you can see my server is running PowerShell version 4.

Here are the steps to upgrade to PowerShell 5.1

Step 1: Download Windows Management Framework 5.1

Click here to download WMF 5.1 from Microsoft.

Note: WMF 5.1 requires .NET Framework 4.5.2 (or above). You can install WMF 5.1 on server 2012 without .NET 4.5.2 but key PowerShell features will fail until you upgrade.

On the download page pick the install file for your operating system.

Step 2: Install and Reboot

Next, install the WMF 5.1 package. This will require a reboot.

All done. Now open PowerShell and check the version again.

$PSVersionTable

Windows 10 (1607 and up) and Windows 11 come with PowerShell 5.1 by default so no need to upgrade. Windows Server 2016 and later also come with PowerShell 5.1.

How to Upgrade to PowerShell Core 7

PowerShell Core is a different platform than the original Windows PowerShell. This means you cannot upgrade the original PowerShell to PowerShell Core 7. PowerShell Core will install separately from the original PowerShell and runs side by side.

In this example, I will install the latest version of PowerShell 7 on a Windows 10 computer. This will install alongside the original PowerShell 5.1 that is already installed with Windows 10.

On the download page look at the right-hand side and you will see a releases section. Click on the latest release version.

Then scroll down to Assets and pick the file that matches your OS.

I’m downloading the win-x64 installer. As you can see there are installer files for other operating systems such as Linux.

Step 2: Install PowerShell Core

Next, run the installer file. It will walk you through an install wizard.

When complete you will have PowerShell Core and the original PowerShell 5.1 installed.

To check which version you have installed you will need to open them separately and run the $PSVersionTable command.

Above you can see the PowerShell Core version on the left and the original on the right.

A faster option for installing PowerShell Core is to use the Winget command.

First, search for the latest PowerShell version with the command below.

winget search Microsoft.PowerShell

Next, Install PowerShell by using the ID from the command output.

winget install --id Microsoft.Powershell --source winget

Update PowerShell Core 6.x to PowerShell 7

If you have PowerShell 6 installed, you can directly update to the latest version of PowerShell 7.

Kind of a mess hu?

Well if you have used Microsoft for very long, you know they change stuff up all the time. It can be frustrating, but there is not much you can do about it.

Update PowerShell on Multiple Computers (GPO)

Since Microsoft provides PowerShell Core as an MSI file you can use group policy to deploy it to multiple computers.

I wrote a guide on how to deploy software using group policy that includes step by step instructions and examples. It’s very easy here is a quick summary of the article.

  • Download MSI install file
  • Create a network share that is available to users. Place the MSI install file here
  • Create and link a GPO to target devices
  • Wait for GPO update on remote computers.

If you use a 3rd party product to push out updates and software packages then I’d recommend using that over group policy.

Frequently Asked Questions

Should I use Powershell 5.1 or PowerShell Core 7?

PowerShell 5.1 is still installed by default on Windows client and server operating systems. Microsoft has no plans to remove 5.1, it will be around for a long time.

Unless PowerShell 7 introduces a needed feature or fix then you should be fine sticking with 5.1. It does include several performance improvements so that might be a reason alone to upgrade.

If you want to move to PowerShell 7 then make sure you test…..test and test. Who knows what it might break, it might not be compatible with a module provided by a vendor or one you created so testing is critical. Microsoft has a module compatibility list of modules known to support PowerShell 7.

I don’t recommend upgrading every machine to 7 just to be on the latest version. I would only upgrade when needed. For personal use however, I see no problem with upgrading to PowerShell 7.

Why upgrade to PowerShell Core 7?

PowerShell 7 does include many features that are long overdue.

  • Pipeline can access multiple scripts at once – This will speed up performance
  • Built in SSH remoting – Allows you to connect to Linux based systems
  • Supports docker containers
  • Cross platform
  • Long term support
  • Secure Credential support – Securely use credentials from local or remove credential store
  • Centralized logging – This was a mess prior to PowerShell core
  • Can be updated via Windows update. – Nice but can also be dangerous

Does Windows 11 have PowerShell Core?

Yes, but the original PowerShell 5.1 is installed by default. You can use the steps in this guide to install PowerShell core on Windows 11.

There you have it. That is how you update PowerShell to the latest version.

Do you use PowerShell 7 or still use 5.1? Let me know in the comments below.

На чтение 3 мин Опубликовано Обновлено

PowerShell — это мощный инструмент командной строки и среда скриптования, входящая в состав операционной системы Windows. Она предоставляет разработчикам и системным администраторам обширный набор функций для автоматизации задач и управления операционной системой.

Однако, встроенная в Windows 7 версия PowerShell может быть устаревшей и несовместимой с некоторыми современными функциями и возможностями. Поэтому, обновление PowerShell до последней версии может стать полезным и необходимым шагом для оптимизации работы системы.

В данной статье мы предоставим пошаговое руководство по обновлению PowerShell на операционной системе Windows 7. Мы расскажем о нескольких способах обновления, включая загрузку и установку последней версии с официального сайта Microsoft, а также использование Windows Update.

Независимо от выбранного способа, важно учесть, что обновление PowerShell может потребовать прав администратора и перезагрузки системы. Поэтому перед началом обновления, убедитесь, что вы выполнили необходимые резервные копии данных и сохраните все открытые файлы и приложения, чтобы не потерять важную информацию.

Содержание

  1. Обновление PowerShell на Windows 7
  2. Подготовка к обновлению
  3. Скачивание необходимых файлов

Обновление PowerShell на Windows 7

Для обновления PowerShell на Windows 7 следуйте следующим шагам:

Шаг Инструкция
1 Откройте веб-браузер и перейдите на официальный сайт PowerShell.
2 Найдите раздел загрузок и выберите версию PowerShell для Windows 7.
3 Скачайте установочный файл PowerShell на ваш компьютер.
4 Запустите установочный файл и следуйте инструкциям мастера установки.
5 После завершения установки, перезагрузите компьютер.
6 Проверьте установку новой версии PowerShell, запустив командную строку и введя команду «powershell -version».

Теперь у вас установлена последняя версия PowerShell на вашей операционной системе Windows 7. Вы можете использовать все новые функции и улучшения, доступные в этой версии PowerShell.

Подготовка к обновлению

Перед тем, как обновить PowerShell на Windows 7, вам понадобится выполнить несколько предварительных шагов:

  1. Убедитесь, что ваша операционная система Windows 7 имеет все последние обновления и патчи. Вы можете проверить наличие обновлений, открыв Панель управления и выбрав пункт «Центр обновления Windows». Здесь вы сможете проверить наличие доступных обновлений и установить их, если необходимо.
  2. Сделайте резервную копию всех важных файлов и данных на вашем компьютере. Во время обновления может произойти сбой, и резервная копия поможет восстановить данные, если что-то пойдет не так.
  3. Проверьте, что у вас уже установлена предыдущая версия PowerShell. Вы можете это сделать, открыв командную строку и введя команду «powershell -version». Если вы видите версию PowerShell, значит он уже установлен.
  4. Определите, какую версию PowerShell вы хотите установить. Посетите официальный сайт PowerShell и загрузите необходимую версию. Обычно рекомендуется устанавливать последнюю стабильную версию.

После выполнения этих шагов вы будете готовы к обновлению PowerShell на Windows 7.

Скачивание необходимых файлов

Перед обновлением PowerShell на операционной системе Windows 7 необходимо скачать несколько файлов. Эти файлы обеспечат корректную работу PowerShell и гарантируют совместимость с вашей версией ОС.

Вот список файлов, которые вам понадобятся:

  1. Windows Management Framework — набор обновлений, включающих PowerShell. Этот пакет содержит последнюю версию PowerShell и другие утилиты для управления Windows.
  2. .NET Framework — необходимое программное обеспечение для работы PowerShell. Убедитесь, что у вас установлена правильная версия .NET Framework, совместимая с Windows 7.

Чтобы скачать эти файлы, пройдите по следующим шагам:

  1. Откройте браузер и перейдите на официальный сайт Microsoft.
  2. Воспользуйтесь функцией поиска на сайте, чтобы найти страницу загрузки Windows Management Framework.
  3. На странице загрузки найдите версию пакета, соответствующую вашей операционной системе, и нажмите кнопку «Скачать».
  4. Подождите, пока загрузка завершится.
  5. Повторите аналогичные шаги для скачивания необходимой версии .NET Framework.

После того, как вы успешно скачали все необходимые файлы, вы готовы приступить к установке обновленной версии PowerShell на Windows 7.

Keeping your PowerShell version up-to-date makes sure that you can use the latest features and cmdlets in your scripts. But how do you update PowerShell?

There are two versions of PowerShell at the moment, Windows PowerShell 5.1 and PowerShell Core (7.x). Most modules are switching over to PowerShell 7, but 5.1 is still mainly used. Luckily we can use those two versions next to each other.

In this article

In this article, I will explain how you can update both versions of PowerShell, and how to install/upgrade to PowerShell 7. If you are unsure which version you are currently using, then check this article on how to view your PowerShell version.

PowerShell 5.1 is still the most commonly used and installed PowerShell version at the moment. If you open the Terminal or PowerShell on a Windows 10/11 computer or Windows Server 2016 and newer and type in $PSVersionTable then you will see that version 5.1 (1) is installed.

powershell latest version

The version number exists out of 4 parts:

Major Minor Build Revision
5 1 22621 963

If you check the PowerShell version on another machine, then you might have noticed that the build and revision numbers are different. Now you might think, how can I update PowerShell so the build numbers match?

The problem here is that PowerShell 5.1 is part of the Windows Management Framework 5.1 and is updated automatically with your Windows Updates. As we can see in the screenshot above, the build and revision numbers match the Build Version of the OS (2).

Good to know is that PowerShell 5.x isn’t developed anymore. The latest version is 5.1 and there won’t be any updates for it anymore. PowerShell Core 7.x is the successor of PowerShell 5.1.

Update from older PowerShell versions

On older operating systems, like Windows Server 2012 R2, you can still find PowerShell 4 installed. PowerShell 3 and 4 can be updated to PowerShell 5.1. To do this we will need to install the Windows Management Framework 5.1, which you can download here at Microsoft. The following operating systems are supported:

  • Windows Server 2012 R2
  • Windows Server 2012
  • Windows Server 2008 R2 SP1
  • Windows 8.1
  • Windows 7 SP1

Make sure that you select the correct version of your OS and that have installed .Net Framework 4.5 or higher.

After the installation, you will need to reboot the computer to use the new PowerShell version.

Upgrade PowerShell

PowerShell Core 7, commonly revert to as PowerShell 7, is a completely new version of PowerShell. One of the biggest differences is that it not only can be used on Windows but also on macOS or Linux for example. This means that we cannot upgrade PowerShell 5.1 to 7, but instead, we can install PowerShell 7 next to version 5.1.

This way you can use both versions simultaneously on a single computer, which is a good thing. Because not all modules and cmdlets are available in PowerShell 7. So before you can fully switch over to the new version, you will need to do a lot of testing to make sure that all your script keep working.

To install PowerShell 7 we have a couple of options:

  • WinGet – The built-in package manager in Windows 10 and 11
  • MSI Installer – Best option for Windows Servers
  • Microsoft Store
  • Dev Home – Currently in preview, but allows you to easily install all required packages on your dev machine. Read more about Dev Home in this article.

Using WinGet to Install PowerShell 7

WinGet is a built-in command line tool in Windows that allows you to install packages on your Windows 10 or 11 computer. The advantage of WinGet is that you only need to run a single command to install a package.

At the moment there are two versions available of PowerShell 7, the stable version and a preview version. I recommend installing the stable version in production environments. To view the available versions you can run the following command:

winget search Microsoft.PowerShell

# Result
Name               Id                           Version Source
---------------------------------------------------------------
PowerShell         Microsoft.PowerShell         7.3.4.0 winget
PowerShell Preview Microsoft.PowerShell.Preview 7.4.0.3 winget

To install PowerShell 7 run the following command:

winget install --id Microsoft.Powershell --source winget

Winget will download the package after which the MSI installer will start:

update powershell

Using the MSI

The Windows Package Manager (Winget) downloads the latest MSI file automatically. If you can’t or don’t want to use WinGet, then you can also download the MSI file manually from the PowerShell GitHub page. Another (easier) option is to use the download link here in the Microsoft documentation.

  1. Open the PowerShell GitHub Page
  2. Click on the latest Release version in the right sidebar
  3. Scroll all the way down on the release page
  4. Download the latest PowerShell-7.x.x-win-x64.msi file

GitHub Repository PowerShell

Open the MSI after it’s downloaded. We have a couple of options that we can enable. I recommend installing all options from the installer:

PowerShell MSI Installation

PowerShell 7 Installer

On the next page, leave both updating options enabled. This way you will always have the latest stable version of PowerShell 7 installed on your computer.

Install with Microsoft Store

Personally, I don’t use the Microsoft Store much, but it’s possible to install PowerShell through the store. Simply open the Store and search for PowerShell 7. Make sure you select PowerShell and not the PowerShell Preview version and click on Get.

Update PowerShell MIcrosoft Store

Using PowerShell 7

PowerShell 7 is a different app/console than PowerShell 5.1. If you open Terminal or PowerShell from the start menu and run the command $PSVersionTable, then you will see that the version number is still 5.1. This is normal because you are actually using PowerShell 5.1 at that moment.

To use PowerShell 7, you have two options:

  • Open it from the Start Menu
  • Open it through Terminal > New Tab

To open it from the start menu, just search for the PowerShell 7 app. This will open the new version in the terminal app.

PowerShell 7 Start Menu

Another option is to use the built-in Windows Terminal. If you click on the drop-down arrow (1) next to the new tab icon, then you can select PowerShell, which is PowerShell 7. We can also change the default PowerShell version in Terminal to PowerShell 7.

Windows Terminal Settings

Click on the drop-down arrow (1), choose Settings, and change the default profile (2) to PowerShell.

If you run the command $PSVersionTable in the new PowerShell console, then you will see that the PSVersion is set to 7.x.x and the PSEdition is Core:

update powershell

Update PowerShell 7 Command

PowerShell Core 7 is being actively developed at the moment. A new release comes out pretty much every month. Now PowerShell 7 should update with your Windows Updates if you have version 7.2 or higher. But we can also manually update PowerShell with a single command to the latest version. For this, we will be using the command-line tool WinGet.

To view which version you have currently installed you can use the WinGet List command below:

winget list --id Microsoft.Powershell

# Result
Name             Id                   Version Available Source
--------------------------------------------------------------
PowerShell 7-x64 Microsoft.PowerShell 7.3.2.0 7.3.4.0   winget

As you see in the results above, PowerShell version 7.3.2 is currently installed. Also, the latest available version is listed, which is at the moment of writing, version 7.3.4. To update PowerShell we can use the upgrade parameter in Winget:

winget upgrade --id Microsoft.Powershell

update powershell command

After the upgrade is complete you will need to reload the console to use the new version.

Wrapping Up

Keeping PowerShell 7 up-to-date is important to make sure that your scripts work on all device. However, PowerShell 5.1, won’t receive any updates anymore, but is still mainly used. Personally I try to write most of my new scripts in PowerShell 7 when possible. This will make them future prove.

I hope this articled helped you with updating PowerShell. If you have any questions or tips, just drop a comment below.

  • Обновить ватсап на пк для windows 10
  • Обмен информацией между различными приложениями windows
  • Обновить все драйвера windows 10 pro
  • Обложки для проигрыватель windows media
  • Обновить браузер microsoft edge для windows 10