- Установка Windows PowerShell Installing Windows PowerShell
- Поиск PowerShell в Windows 10, 8.1, 8.0 и 7 Finding PowerShell in Windows 10, 8.1, 8.0, and 7
- Консоль For Console
- ISE For ISE
- Поиск PowerShell в версиях Windows Server Finding PowerShell in Windows Server versions
- Выпуски Windows Server Core Windows Server Core editions
- Выпуски Windows Server Desktop Windows Server Desktop editions
- Проверка версии PowerShell How to check the version of PowerShell
- Обновление существующей версии Windows PowerShell Upgrading existing Windows PowerShell
- Необходимость Azure PowerShell Need Azure PowerShell
- Использование подсистемы Windows PowerShell 2.0 Using the Windows PowerShell 2.0 Engine
- Прекращение поддержки и соображения безопасности Deprecation and security concerns
- Установка и включение требуемых программ Installing and Enabling Required Programs
- Запуск подсистемы Windows PowerShell 2.0 How to start the Windows PowerShell 2.0 Engine
- Запуск удаленного сеанса с помощью подсистемы Windows PowerShell 2.0 How to start a remote session with the Windows PowerShell 2.0 Engine
- Запуск удаленного сеанса Windows PowerShell 2.0 To start a remote Windows PowerShell 2.0 session
- Запуск фонового задания с помощью подсистемы Windows PowerShell 2.0 How to start a background job with the Windows PowerShell 2.0 Engine
Установка Windows PowerShell Installing Windows PowerShell
Windows PowerShell установлен по умолчанию в каждой ОС Windows, начиная с Windows 7 с пакетом обновления 1 (SP1) и Windows Server 2008 R2 с пакетом обновления 1 (SP1). Windows PowerShell comes installed by default in every Windows, starting with Windows 7 SP1 and Windows Server 2008 R2 SP1.
Если вас интересует PowerShell версии 6 или более поздней, вам нужно установить PowerShell Core вместо Windows PowerShell. If you are interested in PowerShell 6 and later, you need to install PowerShell Core instead of Windows PowerShell. Дополнительные сведения см. в статье Установка PowerShell Core в Windows. For that, see Installing PowerShell Core on Windows.
Поиск PowerShell в Windows 10, 8.1, 8.0 и 7 Finding PowerShell in Windows 10, 8.1, 8.0, and 7
Иногда найти консоль или ISE (интегрированную среду сценариев) PowerShell в Windows бывает непросто, так как их расположение в разных версиях Windows отличается. Sometimes locating PowerShell console or the Integrated Scripting Environment (ISE) in Windows can be difficult, as its location moves from one version of Windows to the next.
Следующие таблицы помогут найти PowerShell в вашей версии Windows. The following tables should help you find PowerShell in your Windows version. Все указанные версии являются оригинальными, сразу после выпуска и без обновлений. All versions listed here are the original version, as released, with no updates.
Консоль For Console
Версия Version | Location Location |
---|---|
Windows 10 Windows 10 | Щелкните значок Windows в левом нижнем углу и начните вводить PowerShell. Click left lower corner Windows icon, start typing PowerShell |
Windows 8.1, 8.0 Windows 8.1, 8.0 | На начальном экране начните вводить PowerShell. On the start screen, start typing PowerShell. Если вы находитесь на рабочем столе, щелкните значок Windows в левом нижнем углу и начните вводить PowerShell. If on desktop, click left lower corner Windows icon, start typing PowerShell |
Windows 7 с пакетом обновления 1 (SP1) Windows 7 SP1 | Щелкните значок Windows в левом нижнем углу и в поле поиска начните вводить PowerShell. Click left lower corner Windows icon, on the search box start typing PowerShell |
ISE For ISE
Версия Version | Location Location |
---|---|
Windows 10 Windows 10 | Щелкните значок Windows в левом нижнем углу и начните вводить ISE. Click left lower corner Windows icon, start typing ISE |
Windows 8.1, 8.0 Windows 8.1, 8.0 | На начальном экране введите PowerShell ISE. On the start screen, type PowerShell ISE. Если вы находитесь на рабочем столе, щелкните значок Windows в левом нижнем углу и введите PowerShell ISE. If on desktop, click left lower corner Windows icon, type PowerShell ISE |
Windows 7 с пакетом обновления 1 (SP1) Windows 7 SP1 | Щелкните значок Windows в левом нижнем углу и в поле поиска начните вводить PowerShell. Click left lower corner Windows icon, on the search box start typing PowerShell |
Поиск PowerShell в версиях Windows Server Finding PowerShell in Windows Server versions
Начиная с Windows Server 2008 R2, операционную систему Windows можно установить без графического пользовательского интерфейса (GUI). Starting with Windows Server 2008 R2, Windows operating system can be installed without the graphical user interface (GUI). Выпуски Windows Server без GUI называются выпусками Core , а выпуски с GUI — Desktop. Editions of Windows Server without GUI are named Core editions, and editions with the GUI are named Desktop.
Выпуски Windows Server Core Windows Server Core editions
Во всех выпусках Core при входе на сервер открывается окно командной строки Windows. In all Core editions, when you log to the server you get a Windows command prompt window.
Введите powershell и нажмите клавишу ВВОД , чтобы запустить PowerShell в сеансе командной строки. Type powershell and press ENTER to start PowerShell inside the command prompt session. Введите exit , чтобы завершить сеанс PowerShell и вернуться к командной строке. Type exit to terminate the PowerShell session and return to command prompt.
Выпуски Windows Server Desktop Windows Server Desktop editions
Во всех выпусках Desktop нужно щелкнуть значок Windows в левом нижнем углу и начать вводить PowerShell. In all desktop editions, click the left lower corner Windows icon, start typing PowerShell. Появятся параметры консоли и ISE. You get both console and ISE options.
Единственное исключение из этого правила — ISE в Windows Server 2008 R2 с пакетом обновления 1 (SP1). В этом случае щелкните значок Windows в левом нижнем углу и введите PowerShell ISE. The only exception to the above rule is the ISE in Windows Server 2008 R2 SP1; in this case, click the left lower corner Windows icon, type PowerShell ISE.
Проверка версии PowerShell How to check the version of PowerShell
Чтобы узнать, какая версия PowerShell установлена, запустите консоль PowerShell (или ISE), введите $PSVersionTable и нажмите клавишу ВВОД. To find which version of PowerShell you have installed, start a PowerShell console (or the ISE) and type $PSVersionTable and press ENTER. Найдите значение PSVersion . Look for the PSVersion value.
Обновление существующей версии Windows PowerShell Upgrading existing Windows PowerShell
В пакет установки для PowerShell входит установщик WMF. The installation package for PowerShell comes inside a WMF installer. Версия установщика WMF совпадает с версией PowerShell. Для Windows PowerShell нет отдельного установщика. The version of the WMF installer matches the version of PowerShell; there’s no stand alone installer for Windows PowerShell.
Если вам нужно обновить существующую версию PowerShell, в Windows используйте следующую таблицу, чтобы найти установщик для нужной версии PowerShell. If you need to update your existing version of PowerShell, in Windows, use the following table to locate the installer for the version of PowerShell you want to update to.
Windows Windows | PS 3.0 PS 3.0 | PS 4.0 PS 4.0 | PS 5.0 PS 5.0 | PS 5.1 PS 5.1 |
---|---|---|---|---|
Windows 10 (см. примечание 1) Windows 10 (see Note1) Windows Server 2016 Windows Server 2016 | — | — | — | установлено installed |
Windows 8.1 Windows 8.1 Windows Server 2012 R2 Windows Server 2012 R2 | — | установлено installed | WMF 5.0 WMF 5.0 | WMF 5.1 WMF 5.1 |
Windows 8 Windows 8 Windows Server 2012 Windows Server 2012 | установлено installed | WMF 4.0 WMF 4.0 | WMF 5.0 WMF 5.0 | WMF 5.1 WMF 5.1 |
Windows 7 с пакетом обновления 1 (SP1) Windows 7 SP1 Windows Server 2008 R2 с пакетом обновления 1 (SP1) Windows Server 2008 R2 SP1 | WMF 3.0 WMF 3.0 | WMF 4.0 WMF 4.0 | WMF 5.0 WMF 5.0 | WMF 5.1 WMF 5.1 |
Если в начальном выпуске Windows 10 включены автоматические обновления, PowerShell обновляется с версии 5.0 до 5.1. On the initial release of Windows 10, with automatic updates enabled, PowerShell gets updated from version 5.0 to 5.1. Если оригинальная версия Windows 10 не обновлена в Центре обновления Windows, версия PowerShell будет 5.0. If the original version of Windows 10 is not updated through Windows Updates, the version of PowerShell is 5.0.
Необходимость Azure PowerShell Need Azure PowerShell
Если вы ищете Azure PowerShell , можно начать с раздела Общие сведения об Azure PowerShell. If you’re looking for Azure PowerShell , you could start with Overview of Azure PowerShell.
Использование подсистемы Windows PowerShell 2.0 Using the Windows PowerShell 2.0 Engine
Windows PowerShell предназначена для обратной совместимости с предыдущими версиями оболочки. Windows PowerShell is designed to be backward compatible with previous versions. Командлеты, поставщики, оснастки, модули и сценарии, написанные для Windows PowerShell 2.0, выполняются в более новых версиях Windows PowerShell без изменений. Cmdlets, providers, snap-ins, modules, and scripts written for Windows PowerShell 2.0 run unchanged in newer versions Windows PowerShell. Однако в Microsoft .NET Framework 4 изменена политика активации среды выполнения. However, Microsoft .NET Framework 4 changed the runtime activation policy. Основные программы Windows PowerShell, написанные для Windows PowerShell 2.0 и скомпилированные с помощью CLR 2.0, не могут выполняться без изменения в новых версиях Windows PowerShell, скомпилированных с помощью CLR 4.0 (или более поздних версий). Windows PowerShell host programs written for Windows PowerShell 2.0 and compiled with Common Language Runtime (CLR) 2.0 cannot run without modification in new versions Windows PowerShell that are compiled with CLR 4.0 (or higher).
Подсистема Windows PowerShell 2.0 предназначена для использования только в том случае, если выполнение существующего сценария или существующей основной программы невозможно из-за несовместимости с Windows PowerShell 5.1. The Windows PowerShell 2.0 Engine is intended to be used only when an existing script or host program cannot run because it is incompatible with Windows PowerShell 5.1. Примерами являются более старые версии модулей Exchange или SQL Server. Examples of this include older versions of Exchange or SQL Server modules. Такие ситуации довольно редки. Such cases are expected to be rare.
Многие программы, требующие использования подсистемы Windows PowerShell 2.0, запускают ее автоматически. Many programs that require the Windows PowerShell 2.0 Engine start it automatically. Эти инструкции предназначены для редких случаев, когда подсистему необходимо запустить вручную. These instructions are included for the rare situations in which you need to start the engine manually.
Прекращение поддержки и соображения безопасности Deprecation and security concerns
Поддержка Windows PowerShell 2.0 была прекращена в августе 2017 г. Windows PowerShell 2.0 was deprecated in August, 2017. Дополнительные сведения см. в объявлении в блоге, посвященном PowerShell. For more information, see the announcement on the PowerShell blog.
В Windows PowerShell 2.0 отсутствует целый ряд функций усиления защиты и обеспечения безопасности, добавленных в версии 3, 4 и 5. Windows PowerShell 2.0 is missing a significant amount of the hardening and security features added in versions 3, 4, and 5. Настоятельно рекомендуется не использовать эту версию продукта. We highly, highly recommend that users not use it if they can help it. Дополнительные сведения см. A Comparison of Shell and Scripting Language Security и в этой записи блога. For more information, see A Comparison of Shell and Scripting Language Security and PowerShell ♥ the Blue Team.
Установка и включение требуемых программ Installing and Enabling Required Programs
Перед запуском подсистемы Windows PowerShell 2.0 включите подсистему Windows PowerShell 2.0 и Microsoft .NET Framework 3.5 с пакетом обновления 1. Before starting the Windows PowerShell 2.0 Engine, enable the Windows PowerShell 2.0 Engine and Microsoft .NET Framework 3.5 with Service Pack 1. Инструкции см. в статье Установка Windows PowerShell. For instructions, see Installing Windows PowerShell.
Системы, где установлена Windows Management Framework 3.0 или более поздние версии, имеют все необходимые компоненты. Systems on which Windows Management Framework 3.0 or higher is installed have all of the required components. Никакая дополнительная настройка не требуется. No further configuration is necessary. Дополнительные сведения об установке Windows Management Framework см. в статье Установка и настройка WMF. For information about installing Windows Management Framework, see Install and configure WMF.
Запуск подсистемы Windows PowerShell 2.0 How to start the Windows PowerShell 2.0 Engine
При запуске Windows PowerShell по умолчанию открывается самая новая версия. When you start Windows PowerShell the newest version starts by default. Для запуска Windows PowerShell с подсистемой Windows PowerShell 2.0 используйте параметр Version в PowerShell.exe . To start Windows PowerShell with the Windows PowerShell 2.0 Engine, use the Version parameter of PowerShell.exe . Команду можно выполнить в любой командной строке, включая Windows PowerShell и Cmd.exe. You can run the command at any command prompt, including Windows PowerShell and Cmd.exe.
Запуск удаленного сеанса с помощью подсистемы Windows PowerShell 2.0 How to start a remote session with the Windows PowerShell 2.0 Engine
Чтобы запустить подсистему Windows PowerShell 2.0 в удаленном сеансе, создайте конфигурацию сеанса (которая также называется конечной точкой ) на удаленном компьютере, которая загружает подсистему Windows PowerShell 2.0. To run the Windows PowerShell 2.0 Engine in a remote session, create a session configuration (also known as an endpoint ) on the remote computer that loads the Windows PowerShell 2.0 Engine. Конфигурация сеанса сохраняется на удаленном компьютере; любой авторизованный пользователь может использовать ее для создания сеансов на основе Windows PowerShell 2.0. The session configuration is saved on the remote computer and can be used by any authorized user to create sessions that use the Windows PowerShell 2.0 Engine.
Это сложная задача, которая обычно выполняется системным администратором. This is an advanced task that is typically performed by a system administrator.
Следующая процедура использует параметр PSVersion командлета Register-PSSessionConfiguration для создания конфигурации сеанса с подсистемой Windows PowerShell 2.0. The following procedure uses the PSVersion parameter of the Register-PSSessionConfiguration cmdlet to create a session configuration that uses the Windows PowerShell 2.0 Engine. Можно также использовать параметр PowerShellVersion командлета New-PSSessionConfigurationFile, чтобы создать файл конфигурации для сеанса, который загружает подсистему Windows PowerShell 2.0, и параметр PSVersion командлета Set-PSSessionConfiguration, чтобы изменить конфигурацию сеанса для использования подсистемы Windows PowerShell 2.0. You can also use the PowerShellVersion parameter of the New-PSSessionConfigurationFile cmdlet to create a session configuration file for a session that loads the Windows PowerShell 2.0 Engine and you can use the PSVersion parameter of the Set-PSSessionConfiguration parameter to change a session configuration to use the Windows PowerShell 2.0 Engine.
Дополнительные сведения о файлах конфигураций сеансов см. в разделе about_Session_Configuration_Files. For more information about session configuration files, see about_Session_Configuration_Files. Дополнительные сведения о конфигурациях сеансов см. в разделе about_Session_Configurations. For information about session configurations, including setup and security, see about_Session_Configurations.
Запуск удаленного сеанса Windows PowerShell 2.0 To start a remote Windows PowerShell 2.0 session
Для создания конфигурации сеанса, требующей подсистемы Windows PowerShell 2.0, используйте параметр PSVersion командлета Register-PSSessionConfiguration со значением 2.0 . To create a session configuration that requires the Windows PowerShell 2.0 Engine, use the PSVersion parameter of the Register-PSSessionConfiguration cmdlet with a value of 2.0 . Выполните команду на компьютере на «стороне сервера» или на принимающей стороне подключения. Run this command on the computer at the «server side» or receiving end of the connection.
Следующий пример команды создает конфигурацию сеанса PS2 на компьютере Server01. The following sample command creates the PS2 session configuration on the Server01 computer. Чтобы выполнить эту команду, запустите Windows PowerShell с параметром Запуск от имени администратора. To run this command, start Windows PowerShell with the Run as administrator option.
Чтобы создать на компьютере Server01 сеанс, использующий конфигурацию сеанса PS2, примените параметр ConfigurationName для командлетов, создающих удаленный сеанс, таких как New-PSSession. To create a session on the Server01 computer that uses the PS2 session configuration, use the ConfigurationName parameter of cmdlets that create a remote session, such as the `New-PSSession cmdlet.
При запуске сеанса, использующего конфигурацию, подсистема Windows PowerShell 2.0 автоматически загружается в него. When a session that uses the session configuration starts, the Windows PowerShell 2.0 Engine is automatically loaded into the session.
Следующая команда запускает сеанс на компьютере Server01, который использует конфигурацию PS2. The following command starts a session on the Server01 computer that uses the PS2 session configuration. Сеанс сохраняется в переменную $s . The command saves the session in the $s variable.
Запуск фонового задания с помощью подсистемы Windows PowerShell 2.0 How to start a background job with the Windows PowerShell 2.0 Engine
Чтобы запустить фоновое задание с помощью подсистемы Windows PowerShell 2.0, используйте параметр PSVersion командлета Start-Job. To start a background job with the Windows PowerShell 2.0 Engine, use the PSVersion parameter of the Start-Job cmdlet.
Следующая команда запускает фоновое задание с помощью подсистемы Windows PowerShell 2.0: The following command starts a background job with the Windows PowerShell 2.0 Engine
Дополнительные сведения о фоновых заданиях см. в разделе about_Jobs. For more information about background jobs, see about_Jobs.