- Интегрированная среда сценариев Windows PowerShell The Windows PowerShell ISE
- Поддержка Support
- Основные возможности Key Features
- Запуск интегрированной среды сценариев Windows PowerShell To start the Windows PowerShell ISE
- Получение справки в интегрированной среде сценариев Windows PowerShell To get Help in the Windows PowerShell ISE
- PowerShell PowerShell
- Использование PowerShell.exe Using PowerShell.exe
- Комментарии Remarks
- Что такое PowerShell? What is PowerShell?
- Shell Shell
- Язык сценария Scripting language
- Управление конфигурацией Configuration management
- Дальнейшие действия Next steps
- Начало работы Getting started
- Использование PowerShell PowerShell in action
- What is PowerShell?
- Shell
- Scripting language
- Configuration management
- Next steps
- Getting started
- PowerShell in action
Интегрированная среда сценариев Windows PowerShell The Windows PowerShell ISE
Интегрированная среда сценариев Windows PowerShell (ISE) является ведущим приложением для Windows PowerShell. The Windows PowerShell Integrated Scripting Environment (ISE) is a host application for Windows PowerShell. В ISE можно запускать команды, записывать и тестировать скрипты, а также выполнять их отладку в едином графическом пользовательском интерфейсе на базе Windows. In the ISE, you can run commands and write, test, and debug scripts in a single Windows-based graphic user interface. ISE поддерживает редактирование нескольких строк, заполнение нажатием клавиши TAB, раскраску синтаксических конструкций, выборочное выполнение, контекстную справку и поддержку письма справа налево. The ISE provides multiline editing, tab completion, syntax coloring, selective execution, context-sensitive help, and support for right-to-left languages. Элементы меню и сочетания клавиш подходят для выполнения большинства тех же задач, которые выполняются в консоли Windows PowerShell. Menu items and keyboard shortcuts are mapped to many of the same tasks that you would do in the Windows PowerShell console. Например, при отладке скрипта в ISE вы можете щелкнуть строку кода на панели редактирования правой кнопкой мыши, чтобы задать точку останова. For example, when you debug a script in the ISE, you can right-click on a line of code in the edit pane to set a breakpoint.
Поддержка Support
ISE была впервые представлена в Windows PowerShell версии 2 и переработана в PowerShell версии 3. The ISE was first introduced with Windows PowerShell V2 and was re-designed with PowerShell V3. ISE поддерживается во всех поддерживаемых версиях Windows PowerShell до версии 5.1 включительно. The ISE is supported in all supported versions of Windows PowerShell up to and including Windows PowerShell V5.1.
Функции для ISE PowerShell больше не разрабатываются. The PowerShell ISE is no longer in active feature development. Как компонент доставки Windows эта среда по-прежнему официально поддерживается для внесения наиболее важных исправлений, связанных с безопасностью и обслуживанием. As a shipping component of Windows, it continues to be officially supported for security and high-priority servicing fixes. Пока что мы не планируем удалять ISE из Windows. We currently have no plans to remove the ISE from Windows.
ISE не поддерживается в PowerShell версии 6 и более поздних версиях. There is no support for the ISE in PowerShell v6 and beyond. Пользователям, которые ищут замену ISE, следует использовать Visual Studio Code с расширением PowerShell. Users looking for replacement for the ISE should use Visual Studio Code with the PowerShell Extension.
Основные возможности Key Features
Основные возможности в Windows PowerShell ISE являются такими: Key features in Windows PowerShell ISE include:
- редактирование нескольких строк. Чтобы вставить пустую строку под текущей строкой в области команд, нажмите клавиши SHIFT + ВВОД . Multiline editing: To insert a blank line under the current line in the Command pane, press SHIFT + ENTER .
- Выборочное выполнение. Чтобы запустить фрагмент сценария, выберите текст, который нужно запустить, и нажмите кнопку Запустить сценарий. Selective execution: To run part of a script, select the text you want to run, and then click the Run Script button. Также можно нажать клавишу F5 . Or, press F5 .
- Контекстная справка. Введите Invoke-Item и нажмите клавишу F1 . Context-sensitive help: Type Invoke-Item , and then press F1 . Откроется файл справки со ссылкой на статью о командлете Invoke-Item . The Help file opens to the article for the Invoke-Item cmdlet.
Интегрированная среда сценариев Windows PowerShell позволяет настроить некоторые аспекты его представления. The Windows PowerShell ISE lets you customize some aspects of its appearance. Она также имеет свой собственный скрипт профиля Windows PowerShell. It also has its own Windows PowerShell profile script.
Запуск интегрированной среды сценариев Windows PowerShell To start the Windows PowerShell ISE
Нажмите кнопку Пуск , выберите раздел Windows PowerShell , а затем щелкните Интегрированная среда скриптов Windows PowerShell. Click Start , select Windows PowerShell , and then click Windows PowerShell ISE. Кроме того, можно ввести powershell_ise.exe в любой командной оболочке или поле «Выполнить». Alternately, you can type powershell_ise.exe in any command shell or in the Run box.
Получение справки в интегрированной среде сценариев Windows PowerShell To get Help in the Windows PowerShell ISE
В меню Справка выберите Справка Windows PowerShell. On the Help menu, click Windows PowerShell Help. Также можно нажать клавишу F1 . Or, press F1 . В открывшемся файле будет описана интегрированная среда сценариев Windows PowerShell и Windows PowerShell, в том числе вся справка, доступная через командлет Get-Help . The file that opens describes Windows PowerShell ISE and Windows PowerShell, including all the help available from the Get-Help cmdlet.
PowerShell PowerShell
Windows PowerShell — это оболочка командной строки на основе задач и язык сценариев, разработанный специально для администрирования системы. Windows PowerShell is a task-based command-line shell and scripting language designed especially for system administration. Созданная на основе .NET Framework служба Windows PowerShell помогает ИТ-специалистам и опытным пользователям в управлении и автоматизации администрирования операционной системы Windows, а также приложений, работающих под управлением Windows. Built on the .NET Framework, Windows PowerShell helps IT professionals and power users control and automate the administration of the Windows operating system and applications that run on Windows.
Использование PowerShell.exe Using PowerShell.exe
Программа командной строки PowerShell.exe запускает сеанс Windows PowerShell в окне командной строки. The PowerShell.exe command-line tool starts a Windows PowerShell session in a Command Prompt window. При использовании PowerShell.exe можно использовать его необязательные параметры для настройки сеанса. When you use PowerShell.exe, you can use its optional parameters to customize the session. Например, можно запустить сеанс, в котором используется конкретная политика выполнения или одна из которых исключает профиль Windows PowerShell. For example, you can start a session that uses a particular execution policy or one that excludes a Windows PowerShell profile. В противном случае сеанс будет таким же, как и любой сеанс, запущенный в консоли Windows PowerShell. Otherwise, the session is the same as any session that is started in the Windows PowerShell console.
Чтобы запустить сеанс Windows PowerShell в окне командной строки, введите команду PowerShell . To start a Windows PowerShell session in a Command Prompt window, type PowerShell . В командную строку добавляется префикс PS , указывающий, что вы используете сеанс Windows PowerShell. A PS prefix is added to the command prompt to indicate that you are in a Windows PowerShell session.
Чтобы запустить сеанс с определенной политикой выполнения, используйте параметр ExecutionPolicy и введите: To start a session with a particular execution policy, use the ExecutionPolicy parameter, and type:
Чтобы запустить сеанс Windows PowerShell без профилей Windows PowerShell, используйте параметр- Profile и введите: To start a Windows PowerShell session without your Windows PowerShell profiles, use the NoProfile parameter, and type:
Чтобы начать сеанс, используйте параметр ExecutionPolicy и введите: To start a session , use the ExecutionPolicy parameter, and type:
Чтобы просмотреть файл справки PowerShell.exe, введите: To see the PowerShell.exe help file, type:
Чтобы завершить сеанс Windows PowerShell в окне командной строки, введите команду exit . To end a Windows PowerShell session in a Command Prompt window, type exit . Типичная Командная строка возвращает. The typical command prompt returns.
Комментарии Remarks
Полный список параметров командной строки PowerShell.exe см. в разделе about_PowerShell.Exe. For a complete list of the PowerShell.exe command-line parameters, see about_PowerShell.Exe.
Дополнительные сведения о других способах запуска Windows PowerShell см. в разделе Запуск Windows PowerShell. For information about other ways to start Windows PowerShell, see Starting Windows PowerShell.
Windows PowerShell выполняется в варианте установки Server Core в операционных системах Windows Server. Windows PowerShell runs on the Server Core installation option of Windows Server operating systems. Тем не менее функции, требующие графического пользовательского интерфейса, такие как Интегрированная среда сценариев Windows PowerShell (ISE), и командлеты Out-GridView и for -Command , не выполняются в установках Server Core. However, features that require a graphic user interface, such as the Windows PowerShell Integrated Scripting Environment (ISE), and the Out-GridView and Show-Command cmdlets, don’t run on Server Core installations.
Что такое PowerShell? What is PowerShell?
PowerShell — это кроссплатформенное решение для автоматизации задач, которое включает оболочку командной строки, скриптовый язык и платформу управления конфигурацией. PowerShell is a cross-platform task automation solution made up of a command-line shell, a scripting language, and a configuration management framework. PowerShell поддерживается в Windows, Linux и macOS. PowerShell runs on Windows, Linux, and macOS.
Shell Shell
PowerShell — это современная командная оболочка, в которой реализованы лучшие возможности других популярных оболочек. PowerShell is modern command shell that includes the best features of other popular shells. В отличие от большинства оболочек, которые только принимают и возвращают текст, PowerShell принимает и возвращает объекты .NET. Unlike most shells that only accept and return text, PowerShell accepts and returns .NET objects. Это решение предлагает следующие возможности: The shell includes the following features:
- надежный журнал командной строки; Robust command-line history
- заполнение нажатием клавиши TAB и подстановка команд (см. раздел about_PSReadLine); Tab completion and command prediction (See about_PSReadLine)
- поддержка [псевдонимов][] команд и параметров; Supports command and parameter aliases
- создание [конвейера][] для объединения команд; Pipeline for chaining commands
- система [справки][] в консоли, похожая на страницы man в Unix. In-console help system, similar to Unix man pages
Язык сценария Scripting language
В качестве скриптового языка PowerShell обычно используется для автоматизации процессов управления системами. As a scripting language, PowerShell is commonly used for automating the management of systems. Это решение также часто используется для создания, тестирования и развертывания решений в средах CI/CD. It is also used to build, test, and deploy solutions, often in CI/CD environments. В основе PowerShell лежит среда CLR .NET. PowerShell is built on the .NET Common Language Runtime (CLR). Все входные и выходные данные являются объектами .NET. All inputs and outputs are .NET objects. Вам не нужно анализировать текстовые выходные данные для извлечения информации из них. No need to parse text output to extract information from output. Скриптовый язык PowerShell предлагает следующие возможности: The PowerShell scripting language includes the following features:
- расширяемость с использованием [функций][], [классов][], [скриптов][] и [модулей][]; Extensible through functions, classes, scripts, and modules
- расширяемая система форматирования для удобного вывода; Extensible formatting system for easy output
- расширяемая система типов для создания динамических типов; Extensible type system for creating dynamic types
- встроенная поддержка распространенных форматов данных, таких как CSV, JSON и XML. Built-in support for common data formats like CSV, JSON, and XML
Управление конфигурацией Configuration management
PowerShell Desired State Configuration (DSC) — это платформа управления в PowerShell, которая позволяет управлять корпоративной инфраструктурой, используя конфигурацию как код. PowerShell Desired State Configuration (DSC) is a management framework in PowerShell that enables you to manage your enterprise infrastructure with configuration as code. С помощью DSC можно выполнять следующие задачи: With DSC, you can:
- создавать декларативные конфигурации и пользовательские скрипты для повторяемых развертываний; Create declarative configurations and custom scripts for repeatable deployments
- применять параметры конфигурации и настраивать информирование о смещении конфигурации; Enforce configuration settings and report on configuration drift
- развертывать конфигурации с помощью моделей принудительной отправки или опроса. Deploy configuration using push or pull models
Дальнейшие действия Next steps
Начало работы Getting started
Не знакомы с PowerShell и не знаете, с чего начать? Are you new to PowerShell and don’t know where to start? Просмотрите следующие ресурсы: Take a look at these resources.
Использование PowerShell PowerShell in action
Узнайте, как PowerShell используется в разных сценариях и на разных платформах. Take a look at how PowerShell is being used in different scenarios and on different platforms.
What is PowerShell?
PowerShell is a cross-platform task automation solution made up of a command-line shell, a scripting language, and a configuration management framework. PowerShell runs on Windows, Linux, and macOS.
Shell
PowerShell is modern command shell that includes the best features of other popular shells. Unlike most shells that only accept and return text, PowerShell accepts and returns .NET objects. The shell includes the following features:
- Robust command-line history
- Tab completion and command prediction (See about_PSReadLine)
- Supports command and parameter aliases
- Pipeline for chaining commands
- In-console help system, similar to Unix man pages
Scripting language
As a scripting language, PowerShell is commonly used for automating the management of systems. It is also used to build, test, and deploy solutions, often in CI/CD environments. PowerShell is built on the .NET Common Language Runtime (CLR). All inputs and outputs are .NET objects. No need to parse text output to extract information from output. The PowerShell scripting language includes the following features:
- Extensible through functions, classes, scripts, and modules
- Extensible formatting system for easy output
- Extensible type system for creating dynamic types
- Built-in support for common data formats like CSV, JSON, and XML
Configuration management
PowerShell Desired State Configuration (DSC) is a management framework in PowerShell that enables you to manage your enterprise infrastructure with configuration as code. With DSC, you can:
- Create declarative configurations and custom scripts for repeatable deployments
- Enforce configuration settings and report on configuration drift
- Deploy configuration using push or pull models
Next steps
Getting started
Are you new to PowerShell and don’t know where to start? Take a look at these resources.
PowerShell in action
Take a look at how PowerShell is being used in different scenarios and on different platforms.