From 2d6090e243c66d9ce81df11a67116a594e1283e5 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Thu, 27 Mar 2025 11:13:54 -0500 Subject: [PATCH] Freshness update --- .../Starting-Windows-PowerShell.md | 39 +++-- ...Accessibility-in-Windows-PowerShell-ISE.md | 44 ++++-- .../Exploring-the-Windows-PowerShell-ISE.md | 35 +++-- ...owerShell-Tab-in-Windows-PowerShell-ISE.md | 28 ++-- ...Debug-Scripts-in-Windows-PowerShell-ISE.md | 78 +++++----- ...-Use-Profiles-in-Windows-PowerShell-ISE.md | 60 ++++---- ...ion-in-the-Script-Pane-and-Console-Pane.md | 23 +-- ...sole-Pane-in-the-Windows-PowerShell-ISE.md | 13 +- ...n-Scripts-in-the-Windows-PowerShell-ISE.md | 38 ++--- .../Introducing-the-Windows-PowerShell-ISE.md | 15 +- ...hortcuts-for-the-Windows-PowerShell-ISE.md | 2 +- .../Other-Useful-Scripting-Objects.md | 29 ++-- ...s-PowerShell-ISE-Scripting-Object-Model.md | 7 +- .../The-ISE-Object-Model-Hierarchy.md | 54 ++++--- .../object-model/The-ISEAddOnTool-Object.md | 32 ++-- .../The-ISEAddOnToolCollection-Object.md | 46 +++--- .../ise/object-model/The-ISEEditor-Object.md | 97 ++++++------- .../ise/object-model/The-ISEFile-Object.md | 41 +++--- .../The-ISEFileCollection-Object.md | 43 +++--- .../object-model/The-ISEMenuItem-Object.md | 21 ++- .../The-ISEMenuItemCollection-Object.md | 43 +++--- .../ise/object-model/The-ISEOptions-Object.md | 137 ++++++++++-------- .../The-ISESnippetCollection-Object.md | 34 +++-- .../ise/object-model/The-ISESnippetObject.md | 17 ++- .../The-ObjectModelRoot-Object.md | 19 ++- .../object-model/The-PowerShellTab-Object.md | 71 ++++----- .../The-PowerShellTabCollection-Object.md | 31 ++-- .../windows-powershell/wmf-overview.md | 12 +- xx.ps1 | 1 + 29 files changed, 618 insertions(+), 492 deletions(-) create mode 100644 xx.ps1 diff --git a/reference/docs-conceptual/windows-powershell/Starting-Windows-PowerShell.md b/reference/docs-conceptual/windows-powershell/Starting-Windows-PowerShell.md index 24b02b093cf9..b3435fab451a 100644 --- a/reference/docs-conceptual/windows-powershell/Starting-Windows-PowerShell.md +++ b/reference/docs-conceptual/windows-powershell/Starting-Windows-PowerShell.md @@ -1,23 +1,23 @@ --- description: This article explains the ways of starting various versions of PowerShell. -ms.date: 03/04/2024 +ms.date: 03/27/2025 title: Starting Windows PowerShell --- # Starting Windows PowerShell -Windows PowerShell is a scripting engine that's embedded into multiple hosts. The most common hosts -you'll start are the interactive command-line `powershell.exe` and the Interactive Scripting -Environment `powershell_ise.exe`. +Windows PowerShell is a scripting engine embedded into multiple hosts. The most common hosts are the +interactive command-line `powershell.exe` and the Interactive Scripting Environment +`powershell_ise.exe`. -## PowerShell has renamed binary +## PowerShell binary name -PowerShell version 6 and higher uses .NET Core. Supported versions are available on Windows, macOS, -and Linux. +PowerShell version 6 and higher uses .NET (Core). Supported versions are available on Windows, +macOS, and Linux. -Beginning in PowerShell 6, the PowerShell binary was renamed `pwsh.exe` for Windows and `pwsh` for -macOS and Linux. You can start PowerShell preview versions using `pwsh-preview`. For more -information, see [About pwsh][04]. +Beginning in PowerShell 6, the PowerShell binary named `pwsh.exe` for Windows and `pwsh` for macOS +and Linux. You can start PowerShell preview versions using `pwsh-preview`. For more information, see +[About pwsh][04]. To find cmdlet reference and installation documentation for PowerShell 7, use the following links: @@ -30,12 +30,12 @@ To find cmdlet reference and installation documentation for PowerShell 7, use th To view content for other PowerShell versions, see [How to use the PowerShell documentation][01]. -### From the Start Menu +### Run from the Start Menu - Open the **Start** menu, type **Windows PowerShell**, select **Windows PowerShell**, then select **Open**. -### At the Command Prompt +### Run from the Command Prompt In Windows Command shell, Windows PowerShell, or Windows PowerShell ISE, to start Windows PowerShell, type: `PowerShell`. @@ -43,7 +43,7 @@ PowerShell, type: `PowerShell`. You can also use the parameters of the `powershell.exe` program to customize the session. For more information, see [about_PowerShell_exe][03]. -### With Administrative privileges (Run as administrator) +### Run with administrative privileges Open the **Start** menu, type **Windows PowerShell**, select **Windows PowerShell**, and then select **Run as administrator**. @@ -52,7 +52,7 @@ select **Run as administrator**. Use any of the following methods to start Windows PowerShell ISE. -### From the Start Menu +### Run from the Start Menu - Open the **Start** menu, type **ISE**, select **Windows PowerShell ISE**, then select **Open**. @@ -61,23 +61,22 @@ Use any of the following methods to start Windows PowerShell ISE. In Windows Command shell, Windows PowerShell, or Windows PowerShell ISE, to start Windows PowerShell, type: `PowerShell_ISE`. In Windows PowerShell, you can use the alias `ise`. -### With Administrative privileges (Run as administrator) +### Run with administrative privileges -Click **Start**, type **ISE**, right-click **Windows PowerShell ISE**, and then click **Run as +Select **Start**, type **ISE**, right-click **Windows PowerShell ISE**, and then click **Run as administrator**. ## Starting the 32-Bit Version of Windows PowerShell -When using a 64-bit computer, **Windows PowerShell (x86)**, a 32-bit version of Windows PowerShell -is installed in addition to the 64-bit version. When you run Windows PowerShell, the 64-bit version -runs by default. +64-bit versions of Windows include a 32-bit version of Windows PowerShell, **Windows PowerShell +(x86)**, in addition to the 64-bit version. The 64-bit version runs by default. However, you might occasionally need to run **Windows PowerShell (x86)**, such as when you're using a module that requires the 32-bit version or when you're connecting remotely to a 32-bit computer. To start a 32-bit version of Windows PowerShell, use any of the following procedures. -- Click **Start**, type **Windows PowerShell**, select **Windows PowerShell (x86)**, then select +- Select **Start**, type **Windows PowerShell**, select **Windows PowerShell (x86)**, then select **Open**. diff --git a/reference/docs-conceptual/windows-powershell/ise/Accessibility-in-Windows-PowerShell-ISE.md b/reference/docs-conceptual/windows-powershell/ise/Accessibility-in-Windows-PowerShell-ISE.md index c63de147996a..25023455ff9c 100644 --- a/reference/docs-conceptual/windows-powershell/ise/Accessibility-in-Windows-PowerShell-ISE.md +++ b/reference/docs-conceptual/windows-powershell/ise/Accessibility-in-Windows-PowerShell-ISE.md @@ -1,6 +1,6 @@ --- description: This topic describes the accessibility features of Windows PowerShell Integrated Scripting Environment (ISE) that you might find helpful. -ms.date: 12/19/2019 +ms.date: 03/27/2025 ms.topic: ui-reference title: Accessibility in Windows PowerShell ISE --- @@ -10,14 +10,14 @@ title: Accessibility in Windows PowerShell ISE This topic describes the accessibility features of Windows PowerShell Integrated Scripting Environment (ISE) that you might find helpful. -- [How to change the size and location of the Console and Script Panes](#how-to-change-the-size-and-location-of-the-console-and-script-panes) -- [Keyboard shortcuts for editing text](#keyboard-shortcuts-for-editing-text) -- [Keyboard shortcuts for running scripts](#keyboard-shortcuts-for-running-scripts) -- [Keyboard shortcuts for customizing the view](#keyboard-shortcuts-for-customizing-the-view) -- [Keyboard shortcuts for debugging scripts](#keyboard-shortcuts-for-debugging-scripts) -- [Keyboard shortcuts for Windows PowerShell tabs](#keyboard-shortcuts-for-windows-powershell-tabs) -- [Keyboard shortcuts for starting and exiting](#keyboard-shortcuts-for-starting-and-exiting) -- [Breakpoint management with cmdlets](#breakpoint-management) +- [How to change the size and location of the Console and Script Panes][04] +- [Keyboard shortcuts for editing text][07] +- [Keyboard shortcuts for running scripts][08] +- [Keyboard shortcuts for customizing the view][05] +- [Keyboard shortcuts for debugging scripts][06] +- [Keyboard shortcuts for Windows PowerShell tabs][10] +- [Keyboard shortcuts for starting and exiting][09] +- [Breakpoint management with cmdlets][03] Microsoft is committed to making its products and services easier for everyone to use. The following topics provide information about the features, products, and services that make Windows PowerShell @@ -29,7 +29,7 @@ make Windows PowerShell ISE more accessible for people with disabilities: - Keyboard Shortcuts - Syntax Coloring Table and the ability to modify several other color settings using the - [$psISE.Options](object-model/The-ISEOptions-Object.md) scripting object. + [$psISE.Options][13] scripting object. - Text Size Change @@ -175,12 +175,24 @@ You can use the following keyboard shortcuts to start the Windows PowerShell con ## Breakpoint Management For the visually impaired, breakpoint information is available through the cmdlets for managing -breakpoints, such as -[Get-PSBreakpoint](/powershell/module/Microsoft.PowerShell.Utility/Get-PSBreakpoint) and -[Set-PSBreakpoint](/powershell/module/Microsoft.PowerShell.Utility/Set-PSBreakpoint). For more -information please see 'How to manage breakpoints' in -[How to Debug Scripts in the Windows PowerShell ISE](How-to-Debug-Scripts-in-Windows-PowerShell-ISE.md). +breakpoints, such as [Get-PSBreakpoint][01] and [Set-PSBreakpoint][02]. For more information please +see 'How to manage breakpoints' in [How to Debug Scripts in the Windows PowerShell ISE][11]. ## See Also -[Introducing the Windows PowerShell ISE](Introducing-the-Windows-PowerShell-ISE.md) +[Introducing the Windows PowerShell ISE][12] + + +[01]: /powershell/module/Microsoft.PowerShell.Utility/Get-PSBreakpoint +[02]: /powershell/module/Microsoft.PowerShell.Utility/Set-PSBreakpoint +[03]: #breakpoint-management +[04]: #how-to-change-the-size-and-location-of-the-console-and-script-panes +[05]: #keyboard-shortcuts-for-customizing-the-view +[06]: #keyboard-shortcuts-for-debugging-scripts +[07]: #keyboard-shortcuts-for-editing-text +[08]: #keyboard-shortcuts-for-running-scripts +[09]: #keyboard-shortcuts-for-starting-and-exiting +[10]: #keyboard-shortcuts-for-windows-powershell-tabs +[11]: How-to-Debug-Scripts-in-Windows-PowerShell-ISE.md +[12]: Introducing-the-Windows-PowerShell-ISE.md +[13]: object-model/The-ISEOptions-Object.md diff --git a/reference/docs-conceptual/windows-powershell/ise/Exploring-the-Windows-PowerShell-ISE.md b/reference/docs-conceptual/windows-powershell/ise/Exploring-the-Windows-PowerShell-ISE.md index f8989f9011be..f457df2ce225 100644 --- a/reference/docs-conceptual/windows-powershell/ise/Exploring-the-Windows-PowerShell-ISE.md +++ b/reference/docs-conceptual/windows-powershell/ise/Exploring-the-Windows-PowerShell-ISE.md @@ -1,7 +1,7 @@ --- description: This article is an overview of the features of the Windows PowerShell ISE ms.custom: ISE-F1-page -ms.date: 05/04/2023 +ms.date: 03/27/2025 ms.topic: ui-reference title: Exploring the Windows PowerShell ISE --- @@ -11,26 +11,25 @@ title: Exploring the Windows PowerShell ISE You can use the Windows PowerShell Integrated Scripting Environment (ISE) to create, run, and debug commands and scripts. -![Screenshot of the full ISE window.](media/exploring-the-windows-powershell-ise/full-ise-window.png) +![Screenshot of the full ISE window.][10] -The Windows PowerShell ISE consists of the menu bar, Windows PowerShell tabs, -the toolbar, script tabs, a Script Pane, a Console Pane, a status bar, a text-size slider and -context-sensitive Help. +The Windows PowerShell ISE consists of the menu bar, Windows PowerShell tabs, the toolbar, script +tabs, a Script Pane, a Console Pane, a status bar, a text-size slider and context-sensitive Help. ## Menu Bar The menu bar contains the **File**, **Edit**, **View**, **Tools**, **Debug**, **Add-ons**, and **Help** menus. -![Screenshot of the menu bar.](media/exploring-the-windows-powershell-ise/ise-menu-bar.png) +![Screenshot of the menu bar.][11] The buttons on the menus allow you to perform tasks related to writing and running scripts and -running commands in the Windows PowerShell ISE. Additionally, an [add-on tool][11] may be placed on -the menu bar by running scripts that use the [The ISE Object Model Hierarchy][10]. +running commands in the Windows PowerShell ISE. Additionally, an [add-on tool][17] may be placed on +the menu bar by running scripts that use the [The ISE Object Model Hierarchy][16]. ## Toolbar -![Screenshot of the tool bar.](media/exploring-the-windows-powershell-ise/ise-tool-bar.png) +![Screenshot of the tool bar.][15] The following buttons are located on the toolbar. @@ -58,7 +57,7 @@ The following buttons are located on the toolbar. ## Windows PowerShell Tabs -![Screenshot of the Windows PowerShell tabs.](media/exploring-the-windows-powershell-ise/ise-powershell-tabs.png) +![Screenshot of the Windows PowerShell tabs.][13] A Windows PowerShell tab is the environment in which a Windows PowerShell script runs. You can open new Windows PowerShell tabs in the Windows PowerShell ISE to create separate environments on your @@ -69,7 +68,7 @@ For more information, see [How to Create a PowerShell Tab in Windows PowerShell ## Script Tab -![Screenshot of the script tabs.](media/exploring-the-windows-powershell-ise/ise-script-tabs.png) +![Screenshot of the script tabs.][14] Displays the name of the script you are editing. You can click a script tab to select the script you want to edit. @@ -78,7 +77,7 @@ When you point to the script tab, the fully qualified path to the script file ap ## Script Pane -![Screenshot of the panes and status bar.](media/exploring-the-windows-powershell-ise/ise-panes.png) +![Screenshot of the panes and status bar.][12] Allows you to create and run scripts. You can open, edit and run existing scripts in the Script Pane. For more information, see [How to Write and Run Scripts in the Windows PowerShell ISE][07]. @@ -108,7 +107,7 @@ Increases or decreases the size of the text on the screen. Help for Windows PowerShell ISE is available on Microsoft Learn. You can open the Help by clicking **Windows PowerShell ISE Help** on the **Help** menu or by pressing the F1 key anywhere except when the cursor is on a cmdlet name in either the Script Pane or the Console Pane. From the -**Help** menu you can also run the `Update-Help` cmdlet, and display the Command Window which +**Help** menu you can also run the `Update-Help` cmdlet, and display the Command Window, which assists you in constructing commands by showing you all the parameters for a cmdlet and enabling you to fill in the parameters in an easy-to-use form. @@ -129,5 +128,11 @@ to fill in the parameters in an easy-to-use form. [07]: How-to-Write-and-Run-Scripts-in-the-Windows-PowerShell-ISE.md [08]: Introducing-the-Windows-PowerShell-ISE.md [09]: Keyboard-Shortcuts-for-the-Windows-PowerShell-ISE.md -[10]: object-model/The-ISE-Object-Model-Hierarchy.md -[11]: object-model/The-ISEAddOnTool-Object.md +[10]: media/exploring-the-windows-powershell-ise/full-ise-window.png +[11]: media/exploring-the-windows-powershell-ise/ise-menu-bar.png +[12]: media/exploring-the-windows-powershell-ise/ise-panes.png +[13]: media/exploring-the-windows-powershell-ise/ise-powershell-tabs.png +[14]: media/exploring-the-windows-powershell-ise/ise-script-tabs.png +[15]: media/exploring-the-windows-powershell-ise/ise-tool-bar.png +[16]: object-model/The-ISE-Object-Model-Hierarchy.md +[17]: object-model/The-ISEAddOnTool-Object.md diff --git a/reference/docs-conceptual/windows-powershell/ise/How-to-Create-a-PowerShell-Tab-in-Windows-PowerShell-ISE.md b/reference/docs-conceptual/windows-powershell/ise/How-to-Create-a-PowerShell-Tab-in-Windows-PowerShell-ISE.md index c24c64e9ee3d..0edaa3a9070b 100644 --- a/reference/docs-conceptual/windows-powershell/ise/How-to-Create-a-PowerShell-Tab-in-Windows-PowerShell-ISE.md +++ b/reference/docs-conceptual/windows-powershell/ise/How-to-Create-a-PowerShell-Tab-in-Windows-PowerShell-ISE.md @@ -1,6 +1,6 @@ --- description: Tabs in the Windows PowerShell Integrated Scripting Environment (ISE) allow you to simultaneously create and use several execution environments within the same application. Each PowerShell tab corresponds to a separate execution environment or session. -ms.date: 10/07/2021 +ms.date: 03/27/2025 ms.topic: ui-reference title: How to Create a PowerShell Tab in Windows PowerShell ISE --- @@ -12,21 +12,20 @@ create and use several execution environments within the same application. Each corresponds to a separate execution environment or session. > [!NOTE] -> Variables, functions, and aliases that you create in one tab do not carry over to another. They +> Variables, functions, and aliases that you create in one tab don't carry over to another. They > are different Windows PowerShell sessions. Use the following steps to open or close a tab in Windows PowerShell. To rename a tab, set the -[DisplayName](object-model/The-PowerShellTab-Object.md#displayname) property on the Windows -PowerShell Tab scripting object. +[DisplayName][04] property on the Windows PowerShell Tab scripting object. ## To create and use a new PowerShell Tab On the **File** menu, click **New PowerShell Tab**. The new PowerShell tab always opens as the -active window. PowerShell tabs are incrementally numbered in the order that they are opened. Each -tab is associated with its own Windows PowerShell console window. You can have up to 32 PowerShell -tabs with their own session open at a time (this is limited to 8 on Windows PowerShell ISE 2.0.) +active window. PowerShell tabs are incrementally numbered in the order that they're opened. Each tab +is associated with its own Windows PowerShell console window. You can have up to 32 PowerShell tabs +with their own session open at a time (this is limited to 8 on Windows PowerShell ISE 2.0.) -Note that clicking the **New** or **Open** icons on the toolbar does not create a new tab with a +Note that clicking the **New** or **Open** icons on the toolbar doesn't create a new tab with a separate session. Instead, those buttons open a new or existing script file on the currently active tab with a session. You can have multiple script files open with each tab and session. The script tabs for a session only appear below the session tabs when the associated session is active. @@ -51,10 +50,15 @@ To close a tab, you can use any of the following techniques: active tab to close the tab. If you have unsaved files open in the PowerShell tab that you are closing, you are prompted to save -or discard them. For more information about how to save a script, see -[How to Save a Script](How-to-Write-and-Run-Scripts-in-the-Windows-PowerShell-ISE.md#how-to-save-a-script). +or discard them. For more information about how to save a script, see [How to Save a Script][02]. ## See Also -- [Introducing the Windows PowerShell ISE](Introducing-the-Windows-PowerShell-ISE.md) -- [How to Use the Console Pane in the Windows PowerShell ISE](How-to-Use-the-Console-Pane-in-the-Windows-PowerShell-ISE.md) +- [Introducing the Windows PowerShell ISE][03] +- [How to Use the Console Pane in the Windows PowerShell ISE][01] + + +[01]: How-to-Use-the-Console-Pane-in-the-Windows-PowerShell-ISE.md +[02]: How-to-Write-and-Run-Scripts-in-the-Windows-PowerShell-ISE.md#how-to-save-a-script +[03]: Introducing-the-Windows-PowerShell-ISE.md +[04]: object-model/The-PowerShellTab-Object.md#displayname diff --git a/reference/docs-conceptual/windows-powershell/ise/How-to-Debug-Scripts-in-Windows-PowerShell-ISE.md b/reference/docs-conceptual/windows-powershell/ise/How-to-Debug-Scripts-in-Windows-PowerShell-ISE.md index 0018b13f5915..d54a8317b71f 100644 --- a/reference/docs-conceptual/windows-powershell/ise/How-to-Debug-Scripts-in-Windows-PowerShell-ISE.md +++ b/reference/docs-conceptual/windows-powershell/ise/How-to-Debug-Scripts-in-Windows-PowerShell-ISE.md @@ -1,6 +1,6 @@ --- description: This article describes how to debug scripts on a local computer by using the Windows PowerShell ISE visual debugging features. -ms.date: 10/07/2021 +ms.date: 03/27/2025 ms.topic: ui-reference title: How to Debug Scripts in Windows PowerShell ISE --- @@ -32,10 +32,9 @@ You can set three types of breakpoints in the Windows PowerShell debugging envir Of these, in the Windows PowerShell ISE debugging environment, only line breakpoints can be set by using the menu or the keyboard shortcuts. The other two types of breakpoints can be set, but they -are set from the Console Pane by using the -[Set-PSBreakpoint](/powershell/module/Microsoft.PowerShell.Utility/Set-PSBreakpoint) cmdlet. This -section describes how you can perform debugging tasks in Windows PowerShell ISE by using the menus -where available, and perform a wider range of commands from the Console Pane by using scripting. +are set from the Console Pane by using the [Set-PSBreakpoint][05] cmdlet. This section describes how +you can perform debugging tasks in Windows PowerShell ISE by using the menus where available, and +perform a wider range of commands from the Console Pane by using scripting. ### To set a breakpoint @@ -45,8 +44,7 @@ want to set a line breakpoint, and press F9 or, on the **Debug** menu Breakpoint**. The following script is an example of how you can set a variable breakpoint from the Console Pane by -using the [Set-PSBreakpoint](/powershell/module/Microsoft.PowerShell.Utility/Set-PSBreakpoint) -cmdlet. +using the [Set-PSBreakpoint][05] cmdlet. ```powershell # This command sets a breakpoint on the Server variable in the Sample.ps1 script. @@ -58,8 +56,7 @@ Set-PSBreakpoint -Script sample.ps1 -Variable Server Displays all breakpoints in the current Windows PowerShell session. On the **Debug** menu, click **List Breakpoints**. The following script is an example of how you can -list all breakpoints from the Console Pane by using the -[Get-PSBreakpoint](/powershell/module/Microsoft.PowerShell.Utility/Get-PSBreakpoint) cmdlet. +list all breakpoints from the Console Pane by using the [Get-PSBreakpoint][03] cmdlet. ```powershell # This command lists all breakpoints in the current session. @@ -70,12 +67,11 @@ Get-PSBreakpoint Removing a breakpoint deletes it. -If you think you might want to use it again later, consider -[Disable a Breakpoint](#disable-a-breakpoint) it instead. Right-click the line where you want to -remove a breakpoint, and then click **ToggleBreakpoint**. Or, click the line where you want to -remove a breakpoint, and on the **Debug** menu, click **Toggle Breakpoint**. The following script is -an example of how to remove a breakpoint with a specified ID from the Console Pane by using the -[Remove-PSBreakpoint](/powershell/module/Microsoft.PowerShell.Utility/Remove-PSBreakpoint) cmdlet. +If you think you might want to use it again later, consider [Disable a Breakpoint][06] it instead. +Right-click the line where you want to remove a breakpoint, and then click **ToggleBreakpoint**. Or, +click the line where you want to remove a breakpoint, and on the **Debug** menu, click **Toggle +Breakpoint**. The following script is an example of how to remove a breakpoint with a specified ID +from the Console Pane by using the [Remove-PSBreakpoint][04] cmdlet. ```powershell # This command deletes the breakpoint with breakpoint ID 2. @@ -88,8 +84,7 @@ To remove all breakpoints defined in the current session, on the **Debug** menu, Breakpoints**. The following script is an example of how to remove all breakpoints from the Console Pane by using -the [Remove-PSBreakpoint](/powershell/module/Microsoft.PowerShell.Utility/Remove-PSBreakpoint) -cmdlet. +the [Remove-PSBreakpoint][04] cmdlet. ```powershell # This command deletes all of the breakpoints in the current session. @@ -98,14 +93,14 @@ Get-PSBreakpoint | Remove-PSBreakpoint ### Disable a Breakpoint -Disabling a breakpoint does not remove it. It turns it off until it is enabled. To disable a -specific line breakpoint, right-click the line where you want to disable a breakpoint, and then -click **Disable Breakpoint**. +Disabling a breakpoint doesn't remove it. It turns it off until it's enabled. To disable a specific +line breakpoint, right-click the line where you want to disable a breakpoint, and then click +**Disable Breakpoint**. Or, click the line where you want to disable a breakpoint, and press F9 or, on the **Debug** menu, click **Disable Breakpoint**. The following script is an example of how you can -remove a breakpoint with a specified ID from the Console Pane using the -[Disable-PSBreakpoint](/powershell/module/microsoft.powershell.utility/disable-psbreakpoint) cmdlet. +remove a breakpoint with a specified ID from the Console Pane using the [Disable-PSBreakpoint][01] +cmdlet. ```powershell # This command disables the breakpoint with breakpoint ID 0. @@ -114,11 +109,10 @@ Disable-PSBreakpoint -Id 0 ### Disable All Breakpoints -Disabling a breakpoint does not remove it; it turns it off until it is enabled. To disable all +Disabling a breakpoint doesn't remove it; it turns it off until it's enabled. To disable all breakpoints in the current session, on the **Debug** menu, click **Disable all Breakpoints**. The following script is an example of how you can disable all breakpoints from the Console Pane by using -the [Disable-PSBreakpoint](/powershell/module/Microsoft.PowerShell.Utility/Disable-PSBreakpoint) -cmdlet. +the [Disable-PSBreakpoint][01] cmdlet. ```powershell # This command disables all breakpoints in the current session. @@ -132,7 +126,7 @@ To enable a specific breakpoint, right-click the line where you want to enable a then click **Enable Breakpoint**. Or, click the line where you want to enable a breakpoint, and then press F9 or, on the **Debug** menu, click **Enable Breakpoint**. The following script is an example of how you can enable specific breakpoints from the Console Pane by using the -[Enable-PSBreakpoint](/powershell/module/Microsoft.PowerShell.Utility/Enable-PSBreakpoint) cmdlet. +[Enable-PSBreakpoint][02] cmdlet. ```powershell # This command enables breakpoints with breakpoint IDs 0, 1, and 5. @@ -143,8 +137,7 @@ Enable-PSBreakpoint -Id 0, 1, 5 To enable all breakpoints defined in the current session, on the **Debug** menu, click **Enable all Breakpoints**. The following script is an example of how you can enable all breakpoints from the -Console Pane by using the -[Enable-PSBreakpoint](/powershell/module/Microsoft.PowerShell.Utility/Enable-PSBreakpoint) cmdlet. +Console Pane by using the [Enable-PSBreakpoint][02] cmdlet. ```powershell # This command enables all breakpoints in the current session. @@ -154,12 +147,11 @@ Get-PSBreakpoint | Enable-PSBreakpoint ## How to manage a debugging session -Before you start debugging, you must set one or more breakpoints. You cannot set a breakpoint unless +Before you start debugging, you must set one or more breakpoints. You can't set a breakpoint unless the script that you want to debug is saved. For directions on of how to set a breakpoint, see -[How to manage breakpoints](#how-to-manage-breakpoints) or -[Set-PSBreakpoint](/powershell/module/Microsoft.PowerShell.Utility/Set-PSBreakpoint). After you -start debugging, you cannot edit a script until you stop debugging. A script that has one or more -breakpoints set is automatically saved before it is run. +[How to manage breakpoints][07] or [Set-PSBreakpoint][05]. After you start debugging, you can't edit +a script until you stop debugging. A script that has one or more breakpoints set is automatically +saved before it's run. ### To start debugging @@ -177,7 +169,7 @@ further breakpoints are encountered. ### To view the call stack The call stack displays the current run location in the script. If the script is running in a -function that was called by a different function, then that is represented in the display by +function that was called by a different function, then that's represented in the display by additional rows in the output. The bottom-most row displays the original script and the line in it in which a function was called. The next line up shows that function and the line in it in which another function might have been called. The top-most row shows the current context of the current @@ -224,16 +216,12 @@ Pane to find the values of variables and call functions that are defined only in ### To display the values of automatic variables You can use the preceding method to display the value of almost all variables while you are -debugging a script. However, these methods do not work for the following automatic variables. +debugging a script. However, these methods don't work for the following automatic variables. - `$_` - - `$input` - - `$MyInvocation` - - `$PSBoundParameters` - - `$args` If you try to display the value of any of these variables, you get the value of that variable for in @@ -267,4 +255,14 @@ C:\ps-test\MyScript.ps1 ## See Also -[Exploring the Windows PowerShell ISE](exploring-the-windows-powershell-ise.md) +[Exploring the Windows PowerShell ISE][08] + + +[01]: /powershell/module/Microsoft.PowerShell.Utility/Disable-PSBreakpoint +[02]: /powershell/module/Microsoft.PowerShell.Utility/Enable-PSBreakpoint +[03]: /powershell/module/Microsoft.PowerShell.Utility/Get-PSBreakpoint +[04]: /powershell/module/Microsoft.PowerShell.Utility/Remove-PSBreakpoint +[05]: /powershell/module/Microsoft.PowerShell.Utility/Set-PSBreakpoint +[06]: #disable-a-breakpoint +[07]: #how-to-manage-breakpoints +[08]: exploring-the-windows-powershell-ise.md diff --git a/reference/docs-conceptual/windows-powershell/ise/How-to-Use-Profiles-in-Windows-PowerShell-ISE.md b/reference/docs-conceptual/windows-powershell/ise/How-to-Use-Profiles-in-Windows-PowerShell-ISE.md index db3c2458497e..e5c7ce25cee1 100644 --- a/reference/docs-conceptual/windows-powershell/ise/How-to-Use-Profiles-in-Windows-PowerShell-ISE.md +++ b/reference/docs-conceptual/windows-powershell/ise/How-to-Use-Profiles-in-Windows-PowerShell-ISE.md @@ -1,15 +1,15 @@ --- description: This article explains how to use Profiles in Windows PowerShell ISE. -ms.date: 10/07/2021 +ms.date: 03/27/2025 title: How to Use Profiles in Windows PowerShell ISE --- # How to Use Profiles in Windows PowerShell ISE -This article explains how to use Profiles in Windows PowerShell® Integrated Scripting Environment -(ISE). We recommend that before performing the tasks in this section, you review -[about_Profiles](/powershell/module/microsoft.powershell.core/about/about_profiles), or in the -Console Pane, type, `Get-Help about_Profiles` and press ENTER. +This article explains how to use Profiles in Windows PowerShell® Integrated Scripting +Environment (ISE). We recommend that before performing the tasks in this section, you review +[about_Profiles][02], or in the Console Pane, type, `Get-Help about_Profiles` and press +ENTER. A profile is a Windows PowerShell ISE script that runs automatically when you start a new session. You can create one or more Windows PowerShell profiles for Windows PowerShell ISE and use them to @@ -20,8 +20,8 @@ available. A profile affects every Windows PowerShell ISE session that you start > [!NOTE] > The Windows PowerShell execution policy determines whether you can run scripts and load a profile. > The default execution policy, "Restricted," prevents all scripts from running, including profiles. -> If you use the "Restricted" policy, the profile cannot load. For more information about execution -> policy, see [about_Execution_Policies](/powershell/module/microsoft.powershell.core/about/about_execution_policies). +> If you use the "Restricted" policy, the profile can't load. For more information about execution +> policy, see [about_Execution_Policies][01]. ## Selecting a profile to use in the Windows PowerShell ISE @@ -31,14 +31,14 @@ Windows PowerShell profiles that apply to all hosts. The profile that you use is determined by how you use Windows PowerShell and Windows PowerShell ISE. - If you use only Windows PowerShell ISE to run Windows PowerShell, then save all your items in one - of the ISE-specific profiles, such as the **CurrentUserCurrentHost** profile for Windows PowerShell - ISE or the **AllUsersCurrentHost** profile for Windows PowerShell ISE. + of the ISE-specific profiles, such as the **CurrentUserCurrentHost** profile for Windows + PowerShell ISE or the **AllUsersCurrentHost** profile for Windows PowerShell ISE. - If you use multiple host programs to run Windows PowerShell, save your functions, aliases, variables, and commands in a profile that affects all host programs, such as the - CurrentUserAllHosts or the **AllUsersAllHosts** profile, and save ISE-specific features, like color - and font customization in the **CurrentUserCurrentHost** profile for Windows PowerShell ISE profile or - the **AllUsersCurrentHost** profile for Windows PowerShell ISE. + CurrentUserAllHosts or the **AllUsersAllHosts** profile, and save ISE-specific features, like + color and font customization in the **CurrentUserCurrentHost** profile for Windows PowerShell ISE + profile or the **AllUsersCurrentHost** profile for Windows PowerShell ISE. The following are profiles that can be created and used in Windows PowerShell ISE. Each profile is saved to its own specific path. @@ -55,42 +55,46 @@ saved to its own specific path. To create a new "Current user, Windows PowerShell ISE" profile, run this command: ```powershell -if (!(Test-Path -Path $PROFILE )) -{ New-Item -Type File -Path $PROFILE -Force } +if (!(Test-Path -Path $PROFILE )) { + New-Item -Type File -Path $PROFILE -Force +} ``` To create a new "All users, Windows PowerShell ISE" profile, run this command: ```powershell -if (!(Test-Path -Path $PROFILE.AllUsersCurrentHost)) -{ New-Item -Type File -Path $PROFILE.AllUsersCurrentHost -Force } +if (!(Test-Path -Path $PROFILE.AllUsersCurrentHost)) { + New-Item -Type File -Path $PROFILE.AllUsersCurrentHost -Force +} ``` To create a new "Current user, All Hosts" profile, run this command: ```powershell -if (!(Test-Path -Path $PROFILE.CurrentUserAllHosts)) -{ New-Item -Type File -Path $PROFILE.CurrentUserAllHosts -Force } +if (!(Test-Path -Path $PROFILE.CurrentUserAllHosts)) { + New-Item -Type File -Path $PROFILE.CurrentUserAllHosts -Force +} ``` To create a new "All users, All Hosts" profile, type: ```powershell -if (!(Test-Path -Path $PROFILE.AllUsersAllHosts)) -{ New-Item -Type File -Path $PROFILE.AllUsersAllHosts -Force } +if (!(Test-Path -Path $PROFILE.AllUsersAllHosts)) { + New-Item -Type File -Path $PROFILE.AllUsersAllHosts -Force +} ``` ## To edit a profile -1. To open the profile, run the command `psEdit` with the variable that specifies the profile you want - to edit. For example, to open the "Current user, Windows PowerShell ISE" profile, type: +1. To open the profile, run the command `psEdit` with the variable that specifies the profile you + want to edit. For example, to open the "Current user, Windows PowerShell ISE" profile, type: `psEdit $PROFILE` 1. Add some items to your profile. The following are a few examples to get you started: - To change the default background color of the Console Pane to blue, in the profile file type: `$psISE.Options.OutputPaneBackground = 'blue'` . For more information about the `$psISE` - variable, see [Windows PowerShell ISE Object Model Reference](object-model/The-ISE-Object-Model-Hierarchy.md). + variable, see [Windows PowerShell ISE Object Model Reference][04]. - To change font size to 20, in the profile file type: `$psISE.Options.FontSize =20` @@ -99,5 +103,11 @@ if (!(Test-Path -Path $PROFILE.AllUsersAllHosts)) ## See Also -- [about_Profiles](/powershell/module/microsoft.powershell.core/about/about_profiles) -- [Introducing the Windows PowerShell ISE](Introducing-the-Windows-PowerShell-ISE.md) +- [about_Profiles][02] +- [Introducing the Windows PowerShell ISE][03] + + +[01]: /powershell/module/microsoft.powershell.core/about/about_execution_policies +[02]: /powershell/module/microsoft.powershell.core/about/about_profiles +[03]: Introducing-the-Windows-PowerShell-ISE.md +[04]: object-model/The-ISE-Object-Model-Hierarchy.md diff --git a/reference/docs-conceptual/windows-powershell/ise/How-to-Use-Tab-Completion-in-the-Script-Pane-and-Console-Pane.md b/reference/docs-conceptual/windows-powershell/ise/How-to-Use-Tab-Completion-in-the-Script-Pane-and-Console-Pane.md index 7eed23e759a5..c72c4696b6ba 100644 --- a/reference/docs-conceptual/windows-powershell/ise/How-to-Use-Tab-Completion-in-the-Script-Pane-and-Console-Pane.md +++ b/reference/docs-conceptual/windows-powershell/ise/How-to-Use-Tab-Completion-in-the-Script-Pane-and-Console-Pane.md @@ -1,6 +1,6 @@ --- description: How to Use Tab Completion in the Script Pane and Console Pane -ms.date: 01/02/2020 +ms.date: 03/27/2025 title: How to Use Tab Completion in the Script Pane and Console Pane --- @@ -11,14 +11,15 @@ Pane. Use the following steps to take advantage of this feature: ## To automatically complete a command entry -In the Command Pane or Script Pane, type a few characters of a command and then press TAB to select -the desired completion text. If multiple items begin with the text that you initially typed, then -continue pressing TAB until the item you want appears. Tab completion can help with typing a cmdlet -name, parameter name, variable name, object property name, or a file path. +In the Command Pane or Script Pane, type a few characters of a command and then press TAB +to select the desired completion text. If multiple items begin with the text that you initially +typed, then continue pressing TAB until the item you want appears. Tab completion can +help with typing a cmdlet name, parameter name, variable name, object property name, or a file path. > [!NOTE] -> In the Script Pane, pressing TAB will automatically complete a command only when you are editing -> `.ps1`, `.psd1`, or `.psm1` files. Tab completion works any time when you are typing in the Command Pane. +> In the Script Pane, pressing TAB will automatically complete a command only when you +> are editing `.ps1`, `.psd1`, or `.psm1` files. Tab completion works any time when you are typing +> in the Command Pane. ## To automatically complete a cmdlet parameter entry @@ -29,5 +30,9 @@ the parameters for the cmdlet in turn. ## See Also -- [Introducing the Windows PowerShell ISE](Introducing-the-Windows-PowerShell-ISE.md) -- [How to Create a PowerShell Tab](How-to-Create-a-PowerShell-Tab-in-Windows-PowerShell-ISE.md) +- [Introducing the Windows PowerShell ISE][02] +- [How to Create a PowerShell Tab][01] + + +[01]: How-to-Create-a-PowerShell-Tab-in-Windows-PowerShell-ISE.md +[02]: Introducing-the-Windows-PowerShell-ISE.md diff --git a/reference/docs-conceptual/windows-powershell/ise/How-to-Use-the-Console-Pane-in-the-Windows-PowerShell-ISE.md b/reference/docs-conceptual/windows-powershell/ise/How-to-Use-the-Console-Pane-in-the-Windows-PowerShell-ISE.md index b05869b8f303..17fceb10b4e9 100644 --- a/reference/docs-conceptual/windows-powershell/ise/How-to-Use-the-Console-Pane-in-the-Windows-PowerShell-ISE.md +++ b/reference/docs-conceptual/windows-powershell/ise/How-to-Use-the-Console-Pane-in-the-Windows-PowerShell-ISE.md @@ -1,6 +1,6 @@ --- description: How to Use the Console Pane in the Windows PowerShell ISE -ms.date: 01/02/2020 +ms.date: 03/27/2025 ms.topic: ui-reference title: How to Use the Console Pane in the Windows PowerShell ISE --- @@ -12,9 +12,8 @@ like the stand-alone Windows PowerShell ISE console window. To run a command in the Console Pane, type a command, and then press ENTER. To enter multiple commands that you want to execute in sequence, type SHIFT+ENTER -between commands. See -[How to Use Tab Completion in the Script Pane and Console Pane](How-to-Use-Tab-Completion-in-the-Script-Pane-and-Console-Pane.md) -for help in typing commands. +between commands. See [How to Use Tab Completion in the Script Pane and Console Pane][01] for help +in typing commands. To stop a command, on the toolbar, click **Stop Operation**, or press CTRL+BREAK. You can also use CTRL+C to stop a command if @@ -37,4 +36,8 @@ in procedures that were needed when they were separate. You can: ## See Also -- [Introducing the Windows PowerShell ISE](Introducing-the-Windows-PowerShell-ISE.md) +- [Introducing the Windows PowerShell ISE][02] + + +[01]: How-to-Use-Tab-Completion-in-the-Script-Pane-and-Console-Pane.md +[02]: Introducing-the-Windows-PowerShell-ISE.md diff --git a/reference/docs-conceptual/windows-powershell/ise/How-to-Write-and-Run-Scripts-in-the-Windows-PowerShell-ISE.md b/reference/docs-conceptual/windows-powershell/ise/How-to-Write-and-Run-Scripts-in-the-Windows-PowerShell-ISE.md index 2ba4e07f144f..14895b0412c3 100644 --- a/reference/docs-conceptual/windows-powershell/ise/How-to-Write-and-Run-Scripts-in-the-Windows-PowerShell-ISE.md +++ b/reference/docs-conceptual/windows-powershell/ise/How-to-Write-and-Run-Scripts-in-the-Windows-PowerShell-ISE.md @@ -1,6 +1,6 @@ --- description: This article describes how to create, edit, run, and save scripts in the Script Pane. -ms.date: 10/07/2021 +ms.date: 03/27/2025 title: How to Write and Run Scripts in the Windows PowerShell ISE --- @@ -20,22 +20,20 @@ files. > The Windows PowerShell execution policy determines whether you can run scripts and load Windows > PowerShell profiles and configuration files. The default execution policy, Restricted, prevents > all scripts from running, and prevents loading profiles. To change the execution policy to allow -> profiles to load and be used, see -> [Set-ExecutionPolicy](/powershell/module/microsoft.powershell.security/set-executionpolicy) and -> [about_Signing](/powershell/module/microsoft.powershell.core/about/about_signing). +> profiles to load and be used, see [Set-ExecutionPolicy][02] and [about_Signing][01]. ### To create a new script file -On the toolbar, click **New**, or on the **File** menu, click **New**. The created file appears in -a new file tab under the current PowerShell tab. Remember that the PowerShell tabs are only visible +On the toolbar, click **New**, or on the **File** menu, click **New**. The created file appears in a +new file tab under the current PowerShell tab. Remember that the PowerShell tabs are only visible when there are more than one. By default a file of type script (`.ps1`) is created, but it can be saved with a new name and extension. Multiple script files can be created in the same PowerShell tab. ### To open an existing script -On the toolbar, click **Open**, or on the **File** menu, click **Open**. In the **Open** dialog -box, select the file you want to open. The opened file appears in a new tab. +On the toolbar, click **Open**, or on the **File** menu, click **Open**. In the **Open** dialog box, +select the file you want to open. The opened file appears in a new tab. ### To close a script tab @@ -72,8 +70,8 @@ case CTRL+C maps to the copy function for the selected tex ## How to write and edit text in the Script Pane You can copy, cut, paste, find, and replace text in the Script Pane. You can also undo and redo the -last action you just performed. The keyboard shortcuts for these actions are the same shortcuts -used for all Windows applications. +last action you just performed. The keyboard shortcuts for these actions are the same shortcuts used +for all Windows applications. ### To enter text in the Script Pane @@ -81,7 +79,7 @@ used for all Windows applications. to Script Pane** in the **View** menu. 1. Create a script. Syntax coloring and tab completion provide a richer editing experience in Windows PowerShell ISE. -1. See [How to Use Tab Completion in the Script Pane and Console Pane](How-to-Use-Tab-Completion-in-the-Script-Pane-and-Console-Pane.md) +1. See [How to Use Tab Completion in the Script Pane and Console Pane][04] for details about using the tab completion feature to help in typing. ### To find text in the Script Pane @@ -154,9 +152,8 @@ menu, click **Save**. ### To save a script in ASCII encoding By default, Windows PowerShell ISE saves new script files (`.ps1`), script data files (`.psd1`), and -script module files (`.psm1`) as Unicode (BigEndianUnicode). To save a script in another -encoding, such as ASCII (ANSI), use the **Save** or **SaveAs** methods on the -[$psISE.CurrentFile](object-model/the-ise-object-model-hierarchy.md) object. +script module files (`.psm1`) as Unicode (BigEndianUnicode). To save a script in another encoding, +such as ASCII (ANSI), use the **Save** or **SaveAs** methods on the [$psISE.CurrentFile][05] object. The following command saves a new script as MyScript.ps1 with ASCII encoding. @@ -180,9 +177,16 @@ $psISE.CurrentFile.encoding Windows PowerShell ISE supports the following encoding options: ASCII, BigEndianUnicode, Unicode, UTF32, UTF7, UTF8, and Default. The value of the Default option varies with the system. -Windows PowerShell ISE doesn't change the encoding of script files when you use the Save or -Save As commands. +Windows PowerShell ISE doesn't change the encoding of script files when you use the Save or Save As +commands. ## See Also -- [Exploring the Windows PowerShell ISE](exploring-the-windows-powershell-ise.md) +- [Exploring the Windows PowerShell ISE][03] + + +[01]: /powershell/module/microsoft.powershell.core/about/about_signing +[02]: /powershell/module/microsoft.powershell.security/set-executionpolicy +[03]: exploring-the-windows-powershell-ise.md +[04]: How-to-Use-Tab-Completion-in-the-Script-Pane-and-Console-Pane.md +[05]: object-model/the-ise-object-model-hierarchy.md diff --git a/reference/docs-conceptual/windows-powershell/ise/Introducing-the-Windows-PowerShell-ISE.md b/reference/docs-conceptual/windows-powershell/ise/Introducing-the-Windows-PowerShell-ISE.md index a7da093393e0..78127aaeee03 100644 --- a/reference/docs-conceptual/windows-powershell/ise/Introducing-the-Windows-PowerShell-ISE.md +++ b/reference/docs-conceptual/windows-powershell/ise/Introducing-the-Windows-PowerShell-ISE.md @@ -1,6 +1,6 @@ --- description: The PowerShell ISE is a host application for Windows PowerShell that allows you to run commands and write, test, and debug scripts in a single Windows-based graphic user interface. -ms.date: 10/07/2021 +ms.date: 03/27/2025 ms.topic: overview title: Introducing the Windows PowerShell ISE --- @@ -22,13 +22,12 @@ ISE is supported in all supported versions of Windows PowerShell up to and inclu PowerShell V5.1. > [!NOTE] -> The PowerShell ISE is no longer in active feature development. As a shipping component of -> Windows, it continues to be officially supported for security and high-priority servicing fixes. -> We currently have no plans to remove the ISE from Windows. +> The PowerShell ISE is no longer in active feature development. As a shipping component of Windows, +> it continues to be officially supported for security and high-priority servicing fixes. We +> currently have no plans to remove the ISE from Windows. > > There is no support for the ISE in PowerShell v6 and beyond. Users looking for replacement for the -> ISE should use [Visual Studio Code](https://code.visualstudio.com/) with the -> [PowerShell Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.PowerShell). +> ISE should use [Visual Studio Code][01] with the [PowerShell Extension][02]. ## Key Features @@ -54,3 +53,7 @@ Alternately, you can type `powershell_ise.exe` in any command shell or in the Ru On the **Help** menu, click **Windows PowerShell Help**. Or, press F1. The file that opens describes Windows PowerShell ISE and Windows PowerShell, including all the help available from the `Get-Help` cmdlet. + + +[01]: https://code.visualstudio.com/ +[02]: https://marketplace.visualstudio.com/items?itemName=ms-vscode.PowerShell diff --git a/reference/docs-conceptual/windows-powershell/ise/Keyboard-Shortcuts-for-the-Windows-PowerShell-ISE.md b/reference/docs-conceptual/windows-powershell/ise/Keyboard-Shortcuts-for-the-Windows-PowerShell-ISE.md index 265e506fbb68..ddefa089623c 100644 --- a/reference/docs-conceptual/windows-powershell/ise/Keyboard-Shortcuts-for-the-Windows-PowerShell-ISE.md +++ b/reference/docs-conceptual/windows-powershell/ise/Keyboard-Shortcuts-for-the-Windows-PowerShell-ISE.md @@ -1,6 +1,6 @@ --- description: This article is a list of the keyboard shortcuts used in the PowerShell ISE. -ms.date: 03/04/2024 +ms.date: 03/27/2025 ms.topic: ui-reference title: Keyboard Shortcuts for the Windows PowerShell ISE --- diff --git a/reference/docs-conceptual/windows-powershell/ise/object-model/Other-Useful-Scripting-Objects.md b/reference/docs-conceptual/windows-powershell/ise/object-model/Other-Useful-Scripting-Objects.md index 55c669dce1a8..9a3b5730f8d4 100644 --- a/reference/docs-conceptual/windows-powershell/ise/object-model/Other-Useful-Scripting-Objects.md +++ b/reference/docs-conceptual/windows-powershell/ise/object-model/Other-Useful-Scripting-Objects.md @@ -1,23 +1,23 @@ --- description: This article describes objects that provide additional scripting functionality in the Windows PowerShell ISE. -ms.date: 06/05/2017 +ms.date: 03/27/2025 title: Other Useful Scripting Objects --- # Other Useful Scripting Objects The following objects provide additional scripting functionality in Windows PowerShell ISE. They -are not part of the **$psISE** hierarchy. +aren't part of the `$psISE` hierarchy. ## Useful Scripting objects ### $psUnsupportedConsoleApplications There are some limitations on how Windows PowerShell ISE interacts with console applications. A -command or an automation script that requires user intervention might not work the way it works -from the Windows PowerShell console. You might want to block these commands or scripts from running -in the Windows PowerShell ISE Command pane. The **$psUnsupportedConsoleApplications** object keeps -a list of such commands. If you try to run the commands in this list, you get a message that they -are not supported. The following script adds an entry to the list. +command or an automation script that requires user intervention might not work the way it works from +the Windows PowerShell console. You might want to block these commands or scripts from running in +the Windows PowerShell ISE Command pane. The **$psUnsupportedConsoleApplications** object keeps a +list of such commands. If you try to run the commands in this list, you get a message that they +aren't supported. The following script adds an entry to the list. ```powershell # List the unsupported commands @@ -32,10 +32,10 @@ $psUnsupportedConsoleApplications ### $psLocalHelp -This is a dictionary object that maintains a context-sensitive mapping between Help topics and -their associated links in the local compiled HTML Help file. It is used to locate the local Help -for a particular topic. You can add or delete topics from this list. The following code example -shows some example key-value pairs that are contained in `$psLocalHelp`. +This is a dictionary object that maintains a context-sensitive mapping between Help topics and their +associated links in the local compiled HTML Help file. It's used to locate the local Help for a +particular topic. You can add or delete topics from this list. The following code example shows some +example key-value pairs that are contained in `$psLocalHelp`. ```powershell # See the local help map @@ -59,7 +59,7 @@ $psLocalHelp.Add("Get-MyNoun", "C:\MyFolder\MyHelpChm.chm::/html/0198854a-1298-5 ### $psOnlineHelp This is a dictionary object that maintains a context-sensitive mapping between topic titles of Help -topics and their associated external URLs. It is used to locate the Help for a particular topic on +topics and their associated external URLs. It's used to locate the Help for a particular topic on the web. You can add or delete topics from this list. ```powershell @@ -82,4 +82,7 @@ $psOnlineHelp.Add("Get-MyNoun", "https://www.mydomain.com/MyNoun.html") ## See Also -[Purpose of the Windows PowerShell ISE Scripting Object Model](./Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) +[Purpose of the Windows PowerShell ISE Scripting Object Model][01] + + +[01]: ./Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md diff --git a/reference/docs-conceptual/windows-powershell/ise/object-model/Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md b/reference/docs-conceptual/windows-powershell/ise/object-model/Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md index 3a2894583699..a430096b69a7 100644 --- a/reference/docs-conceptual/windows-powershell/ise/object-model/Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md +++ b/reference/docs-conceptual/windows-powershell/ise/object-model/Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md @@ -1,6 +1,6 @@ --- description: Purpose of the Windows PowerShell ISE Scripting Object Model -ms.date: 12/31/2019 +ms.date: 03/27/2025 title: Purpose of the Windows PowerShell ISE Scripting Object Model --- @@ -59,4 +59,7 @@ You can use the scripting object model to create keyboard shortcuts for frequent ## See also -- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) +- [The ISE Object Model Hierarchy][01] + + +[01]: The-ISE-Object-Model-Hierarchy.md diff --git a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISE-Object-Model-Hierarchy.md b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISE-Object-Model-Hierarchy.md index c0d38a5e6ffe..5f9f16a92c46 100644 --- a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISE-Object-Model-Hierarchy.md +++ b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISE-Object-Model-Hierarchy.md @@ -1,6 +1,6 @@ --- description: This article shows the hierarchy of objects that are part of Windows PowerShell ISE. -ms.date: 12/31/2019 +ms.date: 03/27/2025 title: The ISE Object Model Hierarchy --- @@ -12,44 +12,54 @@ an object to take you to the reference documentation for the class that defines ## $psISE Object -The `$psISE` object is the [root object](The-ObjectModelRoot-Object.md) of the Windows PowerShell +The `$psISE` object is the [root object][06] of the Windows PowerShell ISE object hierarchy. Located at the top level, it makes the following objects available for scripting: -## [$psISE.CurrentFile](The-ISEFile-Object.md) +## [$psISE.CurrentFile][04] -The `$psISE.CurrentFile` object is an instance of the [ISEFile](The-ISEFile-Object.md) class. +The `$psISE.CurrentFile` object is an instance of the [ISEFile][04] class. -## [$psISE.CurrentPowerShellTab](The-PowerShellTab-Object.md) +## [$psISE.CurrentPowerShellTab][07] -The `$psISE.CurrentPowerShellTab` object is an instance of the [PowerShellTab](The-PowerShellTab-Object.md) class. +The `$psISE.CurrentPowerShellTab` object is an instance of the [PowerShellTab][07] class. ## $psISE.CurrentVisibleHorizontalTool -The `$psISE.CurrentVisibleHorizontalTool` object is an instance of the [ISEAddOnTool](The-ISEAddOnTool-Object.md) -class. It represents the installed add-on tool that is currently docked to the top edge of the -Windows PowerShell ISE window. +The `$psISE.CurrentVisibleHorizontalTool` object is an instance of the [ISEAddOnTool][03] class. It +represents the installed add-on tool that's currently docked to the top edge of the Windows +PowerShell ISE window. ## $psISE.CurrentVisibleVerticalTool -The `$psISE.CurrentVisibleHorizontalTool` object is an instance of the [ISEAddOnTool](The-ISEAddOnTool-Object.md) -class. It represents the installed add-on tool that is currently docked to the right-hand edge of -the Windows PowerShell ISE window. +The `$psISE.CurrentVisibleHorizontalTool` object is an instance of the [ISEAddOnTool][03] class. It +represents the installed add-on tool that's currently docked to the right-hand edge of the Windows +PowerShell ISE window. -## [$psISE.Options](The-ISEOptions-Object.md) +## [$psISE.Options][05] -The `$psISE.Options` object is an instance of the [ISEOptions](The-ISEOptions-Object.md) class. The -ISEOptions object represents various settings for Windows PowerShell ISE. It is an instance of the +The `$psISE.Options` object is an instance of the [ISEOptions][05] class. The ISEOptions object +represents various settings for Windows PowerShell ISE. It's an instance of the Microsoft.PowerShell.Host.ISE.ISEOptions class. -## [$psISE.PowerShellTabs](The-PowerShellTabCollection-Object.md) +## [$psISE.PowerShellTabs][08] -The `$psISE.PowerShellTabs` object is an instance of the [PowerShellTabCollection](The-PowerShellTabCollection-Object.md) -class. It is a collection of all the currently open PowerShell tabs that represent the available -Windows PowerShell run environments on the local computer or on connected remote computers. Each -member in the collection is an instance of the [PowerShellTab](The-PowerShellTab-Object.md) class. +The `$psISE.PowerShellTabs` object is an instance of the [PowerShellTabCollection][08] class. It's a +collection of all the currently open PowerShell tabs that represent the available Windows PowerShell +run environments on the local computer or on connected remote computers. Each member in the +collection is an instance of the [PowerShellTab][07] class. ## See Also -- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) +- [Purpose of the Windows PowerShell ISE Scripting Object Model][01] +- [The ISE Object Model Hierarchy][02] + + +[01]: Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md +[02]: The-ISE-Object-Model-Hierarchy.md +[03]: The-ISEAddOnTool-Object.md +[04]: The-ISEFile-Object.md +[05]: The-ISEOptions-Object.md +[06]: The-ObjectModelRoot-Object.md +[07]: The-PowerShellTab-Object.md +[08]: The-PowerShellTabCollection-Object.md diff --git a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEAddOnTool-Object.md b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEAddOnTool-Object.md index bcc815541d90..6a3d1dac3513 100644 --- a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEAddOnTool-Object.md +++ b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEAddOnTool-Object.md @@ -1,6 +1,6 @@ --- description: An ISEAddonTool object represents an installed add-on tool that provides additional functionality to Windows PowerShell ISE. -ms.date: 06/05/2017 +ms.date: 03/27/2025 title: The ISEAddOnTool Object --- @@ -16,11 +16,10 @@ vertical pane is docked to the right edge of Windows PowerShell ISE. The horizon to the bottom edge. Each PowerShell tab in Windows PowerShell ISE can have its own set of add-on tools installed. See -[$psISE.CurrentPowerShellTab.HorizontalAddOnTools](The-PowerShellTab-Object.md) and -[$psISE.CurrentPowerShellTab.VerticalAddOnTools](The-PowerShellTab-Object.md) to access the -collection of tools available to the currently selected tab or the same properties on any of the -**PowerShellTab** objects in the [$psISE.PowerShellTabs](The-PowerShellTabCollection-Object.md) -collection object. +[$psISE.CurrentPowerShellTab.HorizontalAddOnTools][04] and +[$psISE.CurrentPowerShellTab.VerticalAddOnTools][04] to access the collection of tools available to +the currently selected tab or the same properties on any of the **PowerShellTab** objects in the +[$psISE.PowerShellTabs][05] collection object. ## Methods @@ -36,7 +35,7 @@ The **Control** property provides read access to many of the details of the Comm ```powershell # View the properties of the Commands add-on tool. -# (assumes that it is visible in the vertical pane) +# (assumes that it's visible in the vertical pane) $psISE.CurrentVisibleVerticalTool.Control ``` @@ -152,10 +151,10 @@ Dispatcher : System.Windows.Threading.Dispatcher Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. The Boolean property that indicates whether the add-on tool is currently visible in its assigned -pane. If it is visible, you can set the **IsVisible** property to `$false` to hide the tool, or set +pane. If it's visible, you can set the **IsVisible** property to `$false` to hide the tool, or set the **IsVisible** property to `$true` to make an add-on tool visible on its PowerShell tab. Note -that after an add-on tool is hidden, it is no longer accessible through the -**CurrentVisibleHorizontalTool** or **CurrentVisibleVerticalTool** objects, and therefore cannot be +that after an add-on tool is hidden, it's no longer accessible through the +**CurrentVisibleHorizontalTool** or **CurrentVisibleVerticalTool** objects, and therefore can't be made visible by using this property on that object. ```powershell @@ -182,6 +181,13 @@ Commands ## See Also -- [The ISEAddOnToolCollection Object](The-ISEAddOnToolCollection-Object.md) -- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) +- [The ISEAddOnToolCollection Object][03] +- [Purpose of the Windows PowerShell ISE Scripting Object Model][01] +- [The ISE Object Model Hierarchy][02] + + +[01]: Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md +[02]: The-ISE-Object-Model-Hierarchy.md +[03]: The-ISEAddOnToolCollection-Object.md +[04]: The-PowerShellTab-Object.md +[05]: The-PowerShellTabCollection-Object.md diff --git a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEAddOnToolCollection-Object.md b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEAddOnToolCollection-Object.md index e40da29044a3..cb3fda24ac6a 100644 --- a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEAddOnToolCollection-Object.md +++ b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEAddOnToolCollection-Object.md @@ -1,6 +1,6 @@ --- description: The ISEAddOnToolCollection object is a collection of **ISEAddOnTool** objects. -ms.date: 12/31/2019 +ms.date: 03/27/2025 title: The ISEAddOnToolCollection Object --- @@ -11,36 +11,33 @@ The **ISEAddOnToolCollection** object is a collection of **ISEAddOnTool** object ## Methods -### Add\( Name, ControlType, \[IsVisible\] \) +### `Add( Name, ControlType, [IsVisible] )` Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. Adds a new add-on tool to the collection. It returns the newly added add-on tool. Before you run this command, you must install the add-on tool on the local computer and load the assembly. -**Name** - String -Specifies the display name of the add-on tool that is added to Windows PowerShell ISE. - -**ControlType** -Type -Specifies the control that is added. - -**\[IsVisible\]** - optional Boolean -If set to `$true`, the add-on tool is immediately visible in the associated tool pane. +- **Name** - String - Specifies the display name of the add-on tool that's added to Windows PowerShell + ISE. +- **ControlType** - Type - Specifies the control that's added. +- **[IsVisible]** - optional Boolean - If set to `$true`, the add-on tool is immediately visible in + the associated tool pane. ```powershell # Load a DLL with an add-on and then add it to the ISE -[Reflection.Assembly]::LoadFile("C:\test\ISESimpleSolution\ISESimpleSolution.dll") +[Reflection.Assembly]::LoadFile("C:testISESimpleSolutionISESimpleSolution.dll") $psISE.CurrentPowerShellTab.VerticalAddOnTools.Add("Solutions", [ISESimpleSolution.Solution], $true) ``` -### Remove\( Item \) +### `Remove(Item)` Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. Removes the specified add-on tool from the collection. -**Item** - Microsoft.PowerShell.Host.ISE.ISEAddOnTool -Specifies the object to be removed from Windows PowerShell ISE. +- **Item** - Microsoft.PowerShell.Host.ISE.ISEAddOnTool - Specifies the object to be removed from + Windows PowerShell ISE. ```powershell # Load a DLL with an add-on and then add it to the ISE @@ -48,14 +45,13 @@ Specifies the object to be removed from Windows PowerShell ISE. $psISE.CurrentPowerShellTab.VerticalAddOnTools.Add("Solutions", [ISESimpleSolution.Solution], $true) ``` -### SetSelectedPowerShellTab\( psTab \) +### `SetSelectedPowerShellTab(psTab)` Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. Selects the PowerShell tab that the **psTab** parameter specifies. -**psTab** - Microsoft.PowerShell.Host.ISE.PowerShellTab -The PowerShell tab to select. +- **psTab** - Microsoft.PowerShell.Host.ISE.PowerShellTab -The PowerShell tab to select. ```powershell $newTab = $psISE.PowerShellTabs.Add() @@ -63,14 +59,13 @@ $newTab = $psISE.PowerShellTabs.Add() $newTab.DisplayName = 'Brand New Tab' ``` -### Remove\( psTab \) +### `Remove(psTab)` Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. Removes the PowerShell tab that the **psTab** parameter specifies. -**psTab** - Microsoft.PowerShell.Host.ISE.PowerShellTab -The PowerShell tab to remove. +- **psTab** - Microsoft.PowerShell.Host.ISE.PowerShellTab - The PowerShell tab to remove. ```powershell $newTab = $psISE.PowerShellTabs.Add() @@ -82,6 +77,11 @@ $psISE.PowerShellTabs.Remove($newTab) ## See Also -- [The PowerShellTab Object](The-PowerShellTab-Object.md) -- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) +- [The PowerShellTab Object][03] +- [Purpose of the Windows PowerShell ISE Scripting Object Model][01] +- [The ISE Object Model Hierarchy][02] + + +[01]: Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md +[02]: The-ISE-Object-Model-Hierarchy.md +[03]: The-PowerShellTab-Object.md diff --git a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEEditor-Object.md b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEEditor-Object.md index 89bfbd89ad3d..a28ae56736cc 100644 --- a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEEditor-Object.md +++ b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEEditor-Object.md @@ -1,19 +1,18 @@ --- description: An ISEEditor object is an instance of the Microsoft.PowerShell.Host.ISE.ISEEditor class. The Console pane is an ISEEditor object. -ms.date: 12/31/2019 +ms.date: 03/27/2025 title: The ISEEditor Object --- # The ISEEditor Object An **ISEEditor** object is an instance of the Microsoft.PowerShell.Host.ISE.ISEEditor class. The -Console pane is an **ISEEditor** object. Each [ISEFile](The-ISEFile-Object.md) object has an -associated **ISEEditor** object. The following sections list the methods and properties of an -**ISEEditor** object. +Console pane is an **ISEEditor** object. Each [ISEFile][04] object has an associated **ISEEditor** +object. The following sections list the methods and properties of an **ISEEditor** object. ## Methods -### Clear\(\) +### `Clear()` Supported in Windows PowerShell ISE 2.0 and later. @@ -24,7 +23,7 @@ Clears the text in the editor. $psISE.CurrentPowerShellTab.ConsolePane.Clear() ``` -### EnsureVisible\(int lineNumber\) +### `EnsureVisible(int lineNumber)` Supported in Windows PowerShell ISE 2.0 and later. @@ -32,15 +31,14 @@ Scrolls the editor so that the line that corresponds to the specified **lineNumb is visible. It throws an exception if the specified line number is outside the range of 1,last line number, which defines the valid line numbers. -**lineNumber** -The number of the line that is to be made visible. +- **lineNumber** - The number of the line that's to be made visible. ```powershell # Scrolls the text in the Script pane so that the fifth line is in view. $psISE.CurrentFile.Editor.EnsureVisible(5) ``` -### Focus\(\) +### `Focus()` Supported in Windows PowerShell ISE 2.0 and later. @@ -51,70 +49,59 @@ Sets the focus to the editor. $psISE.CurrentPowerShellTab.ConsolePane.Focus() ``` -### GetLineLength\(int lineNumber \) +### `GetLineLength(int lineNumber )` Supported in Windows PowerShell ISE 2.0 and later. -Gets the line length as an integer for the line that is specified by the line number. +Gets the line length as an integer for the line that's specified by the line number. -**lineNumber** -The number of the line of which to get the length. - -**Returns** -The line length for the line at the specified line number. +- **lineNumber** - The number of the line of which to get the length. +- **Returns** - The line length for the line at the specified line number. ```powershell # Gets the length of the first line in the text of the Command pane. $psISE.CurrentPowerShellTab.ConsolePane.GetLineLength(1) ``` -### GoToMatch\(\) +### GoToMatch() Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. Moves the caret to the matching character if the **CanGoToMatch** property of the editor object is -`$true`, which occurs when the caret is immediately before an opening parenthesis, bracket, or -brace - `(`,`[`,`{` - or immediately after a closing parenthesis, bracket, or brace - `)`,`]`,`}`. The caret -is placed before an opening character or after a closing character. If the **CanGoToMatch** property -is `$false`, then this method does nothing. +`$true`, which occurs when the caret is immediately before an opening parenthesis, bracket, or brace +- `(`,`[`,`{` - or immediately after a closing parenthesis, bracket, or brace - `)`,`]`,`}`. The +caret is placed before an opening character or after a closing character. If the **CanGoToMatch** +property is `$false`, then this method does nothing. ```powershell # Goes to the matching character if CanGoToMatch() is $true $psISE.CurrentPowerShellTab.ConsolePane.GoToMatch() ``` -### InsertText\( text \) +### `InsertText( text )` Supported in Windows PowerShell ISE 2.0 and later. Replaces the selection with text or inserts text at the current caret position. -**text** - String -The text to insert. +- **text** - String - The text to insert. -See the [Scripting Example](#scripting-example) later in this topic. +See the [Scripting Example][01] later in this topic. -### Select\( startLine, startColumn, endLine, endColumn \) +### `Select( startLine, startColumn, endLine, endColumn )` Supported in Windows PowerShell ISE 2.0 and later. Selects the text from the **startLine**, **startColumn**, **endLine**, and **endColumn** parameters. -**startLine** - Integer -The line where the selection starts. - -**startColumn** - Integer -The column within the start line where the selection starts. - -**endLine** - Integer -The line where the selection ends. +- **startLine** - Integer - The line where the selection starts. +- **startColumn** - Integer - The column within the start line where the selection starts. +- **endLine** - Integer - The line where the selection ends. +- **endColumn** - Integer - The column within the end line where the selection ends. -**endColumn** - Integer -The column within the end line where the selection ends. +See the [Scripting Example][01] later in this topic. -See the [Scripting Example](#scripting-example) later in this topic. - -### SelectCaretLine\(\) +### `SelectCaretLine()` Supported in Windows PowerShell ISE 2.0 and later. @@ -127,25 +114,22 @@ $psISE.CurrentFile.Editor.SetCaretPosition(5,1) $psISE.CurrentFile.Editor.SelectCaretLine() ``` -### SetCaretPosition\( lineNumber, columnNumber \) +### `SetCaretPosition( lineNumber, columnNumber )` Supported in Windows PowerShell ISE 2.0 and later. Sets the caret position at the line number and the column number. It throws an exception if either the caret line number or the caret column number are out of their respective valid ranges. -**lineNumber** - Integer -The caret line number. - -**columnNumber** - Integer -The caret column number. +- **lineNumber** - Integer - The caret line number. +- **columnNumber** - Integer - The caret column number. ```powershell # Set the CaretPosition. $psISE.CurrentFile.Editor.SetCaretPosition(5,1) ``` -### ToggleOutliningExpansion\(\) +### `ToggleOutliningExpansion()` Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. @@ -164,7 +148,7 @@ Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier ve The read-only Boolean property to indicate whether the caret is next to a parenthesis, bracket, or brace - `()`, `[]`, `{}`. If the caret is immediately before the opening character or immediately -after the closing character of a pair, then this property value is `$true`. Otherwise, it is +after the closing character of a pair, then this property value is `$true`. Otherwise, it's `$false`. ```powershell @@ -222,7 +206,7 @@ Supported in Windows PowerShell ISE 2.0 and later. The read-only property that gets the selected text from the editor. -See the [Scripting Example](#scripting-example) later in this topic. +See the [Scripting Example][01] later in this topic. ### Text @@ -230,7 +214,7 @@ Supported in Windows PowerShell ISE 2.0 and later. The read/write property that gets or sets the text in the editor. -See the [Scripting Example](#scripting-example) later in this topic. +See the [Scripting Example][01] later in this topic. ## Scripting Example @@ -263,7 +247,14 @@ $myEditor.InsertText($selection.ToLower()) ## See Also -- [The ISEFile Object](The-ISEFile-Object.md) -- [The PowerShellTab Object](The-PowerShellTab-Object.md) -- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) +- [The ISEFile Object][04] +- [The PowerShellTab Object][05] +- [Purpose of the Windows PowerShell ISE Scripting Object Model][02] +- [The ISE Object Model Hierarchy][03] + + +[01]: #scripting-example +[02]: Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md +[03]: The-ISE-Object-Model-Hierarchy.md +[04]: The-ISEFile-Object.md +[05]: The-PowerShellTab-Object.md diff --git a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEFile-Object.md b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEFile-Object.md index b601303d2b4e..d603f4855c2e 100644 --- a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEFile-Object.md +++ b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEFile-Object.md @@ -1,31 +1,30 @@ --- description: An ISEFile object represents a file in Windows PowerShell ISE. -ms.date: 12/31/2019 +ms.date: 03/27/2025 title: The ISEFile Object --- # The ISEFile Object An **ISEFile** object represents a file in Windows PowerShell Integrated Scripting Environment -(ISE). It is an instance of the **Microsoft.PowerShell.Host.ISE.ISEFile** class. This topic lists -its member methods and member properties. The `$psISE.CurrentFile` and the files in the Files -collection in a PowerShell tab are all instances of the ****Microsoft.PowerShell.Host.ISE.ISEFile** -class. +(ISE). It's an instance of the **Microsoft.PowerShell.Host.ISE.ISEFile** class. This topic lists its +member methods and member properties. The `$psISE.CurrentFile` and the files in the Files collection +in a PowerShell tab are all instances of the **Microsoft.PowerShell.Host.ISE.ISEFile** class. ## Methods -### Save\( \[saveEncoding\] \) +### Save( [saveEncoding] ) Supported in Windows PowerShell ISE 2.0 and later. Saves the file to disk. -`[saveEncoding]` - optional [System.Text.Encoding](/dotnet/api/system.text.encoding) An optional +`[saveEncoding]` - optional [System.Text.Encoding][01] An optional character encoding parameter to be used for the saved file. The default value is **UTF8**. ### Exceptions -- **System.IO.IOException**: The file could not be saved. +- **System.IO.IOException**: The file couldn't be saved. ```powershell # Save the file using the default encoding (UTF8) @@ -39,7 +38,7 @@ $myfile = $psISE.CurrentFile $myfile.Encoding ``` -### SaveAs\(filename, \[saveEncoding\]\) +### SaveAs(filename, [saveEncoding]) Supported in Windows PowerShell ISE 2.0 and later. @@ -48,14 +47,14 @@ Saves the file with the specified file name and encoding. **filename** - String The name to be used to save the file. -`[saveEncoding]` - optional [System.Text.Encoding](/dotnet/api/system.text.encoding) An optional +`[saveEncoding]` - optional [System.Text.Encoding][01] An optional character encoding parameter to be used for the saved file. The default value is **UTF8**. ### Exceptions - **System.ArgumentNullException**: The **filename** parameter is null. - **System.ArgumentException**: The **filename** parameter is empty. -- **System.IO.IOException**: The file could not be saved. +- **System.IO.IOException**: The file couldn't be saved. ```powershell # Save the file with a full path and name. @@ -72,8 +71,8 @@ $psISE.CurrentFile.SaveAs($fullPath, [System.Text.Encoding]::UTF8) Supported in Windows PowerShell ISE 2.0 and later. The read-only property that gets the string that contains the display name of this file. The name is -shown on the **File** tab at the top of the editor. The presence of an asterisk `(*)` at the end of -the name indicates that the file has changes that have not been saved. +shown on the **File** tab at the top of the editor. The presence of an asterisk (`*`) at the end of +the name indicates that the file has changes that haven't been saved. ```powershell # Shows the display name of the file. @@ -84,8 +83,7 @@ $psISE.CurrentFile.DisplayName Supported in Windows PowerShell ISE 2.0 and later. -The read-only property that gets the [editor object](The-ISEEditor-Object.md) that is used for the -specified file. +The read-only property that gets the [editor object][04] that's used for the specified file. ```powershell # Gets the editor and the text. @@ -143,6 +141,13 @@ $psISE.CurrentFile.IsUntitled ## See Also -- [The ISEFileCollectionObject](The-ISEFileCollection-Object.md) -- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) +- [The ISEFileCollectionObject][05] +- [Purpose of the Windows PowerShell ISE Scripting Object Model][02] +- [The ISE Object Model Hierarchy][03] + + +[01]: /dotnet/api/system.text.encoding +[02]: Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md +[03]: The-ISE-Object-Model-Hierarchy.md +[04]: The-ISEEditor-Object.md +[05]: The-ISEFileCollection-Object.md diff --git a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEFileCollection-Object.md b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEFileCollection-Object.md index 6bf1a10f1382..d4461b66f61f 100644 --- a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEFileCollection-Object.md +++ b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEFileCollection-Object.md @@ -1,6 +1,6 @@ --- description: The ISEFileCollection object is a collection of ISEFile objects. -ms.date: 12/31/2019 +ms.date: 03/27/2025 title: The ISEFileCollection Object --- @@ -11,54 +11,56 @@ The **ISEFileCollection** object is a collection of **ISEFile** objects. An exam ## Methods -### Add\( \[FullPath\] \) +### `Add( [FullPath] )` Supported in Windows PowerShell ISE 2.0 and later. Creates and returns a new untitled file and adds it to the collection. The **IsUntitled** property of the newly created file is `$true`. -**\[FullPath\]** - Optional string The fully specified path of the file. An exception is generated -if you include the **FullPath** parameter and a relative path, or if you use a file name instead of -the full path. +- **[FullPath]** - Optional string - The fully specified path of the file. An exception is generated + if you include the **FullPath** parameter and a relative path, or if you use a file name instead + of the full path. ```powershell # Adds a new untitled file to the collection of files in the current PowerShell tab. $newFile = $psISE.CurrentPowerShellTab.Files.Add() -# Adds a file specified by its full path to the collection of files in the current PowerShell tab. +# Adds a file specified by its full path to the collection of files in the current +# PowerShell tab. $psISE.CurrentPowerShellTab.Files.Add("$PSHOME\Examples\profile.ps1") ``` -### Remove\( File, \[Force\] \) +### `Remove( File, [Force] )` Supported in Windows PowerShell ISE 2.0 and later. Removes a specified file from the current PowerShell tab. -**File** - String The ISEFile file that you want to remove from the collection. If the file has not +**File** - String The ISEFile file that you want to remove from the collection. If the file hasn't been saved, this method throws an exception. Use the **Force** switch parameter to force the removal of an unsaved file. -**\[Force\]** - optional Boolean If set to `$true`, grants permission to remove the file even if it -has not been saved after last use. The default is `$false`. +**[Force]** - optional Boolean If set to `$true`, grants permission to remove the file even if it +hasn't been saved after last use. The default is `$false`. ```powershell -# Removes the first opened file from the file collection associated with the current PowerShell tab. -# If the file has not yet been saved, then an exception is generated. +# Removes the first opened file from the file collection associated with the current +# PowerShell tab. If the file hasn't yet been saved, then an exception is generated. $firstfile = $psISE.CurrentPowerShellTab.Files[0] $psISE.CurrentPowerShellTab.Files.Remove($firstfile) -# Removes the first opened file from the file collection associated with the current PowerShell tab, even if it has not been saved. +# Removes the first opened file from the file collection associated with the current +# PowerShell tab, even if it hasn't been saved. $firstfile = $psISE.CurrentPowerShellTab.Files[0] $psISE.CurrentPowerShellTab.Files.Remove($firstfile, $true) ``` -### SetSelectedFile\( selectedFile \) +### `SetSelectedFile( selectedFile )` Supported in Windows PowerShell ISE 2.0 and later. -Selects the file that is specified by the **SelectedFile** parameter. +Selects the file that's specified by the **SelectedFile** parameter. **SelectedFile** - Microsoft.PowerShell.Host.ISE.ISEFile The ISEFile file that you want to select. @@ -71,6 +73,11 @@ $psISE.CurrentPowerShellTab.Files.SetSelectedFile($firstfile) ## See Also -- [The ISEFile Object](The-ISEFile-Object.md) -- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) +- [The ISEFile Object][03] +- [Purpose of the Windows PowerShell ISE Scripting Object Model][01] +- [The ISE Object Model Hierarchy][02] + + +[01]: Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md +[02]: The-ISE-Object-Model-Hierarchy.md +[03]: The-ISEFile-Object.md diff --git a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEMenuItem-Object.md b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEMenuItem-Object.md index 39c66e7ddea6..985de3e7d6cf 100644 --- a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEMenuItem-Object.md +++ b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEMenuItem-Object.md @@ -1,6 +1,6 @@ --- description: An ISEMenuItem object is an instance of the Microsoft.PowerShell.Host.ISE.ISEMenuItem class. All menu objects on the **Add-ons** menu are instances of the ISEMenuItem class. -ms.date: 10/05/2021 +ms.date: 03/27/2025 title: The ISEMenuItem Object --- @@ -59,7 +59,7 @@ $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus[0].Shortcut Supported in Windows PowerShell ISE 2.0 and later. -The read-only property that gets the [list of submenus](The-ISEMenuItemCollection-Object.md) of the +The read-only property that gets the [list of submenus][03] of the menu item. ```powershell @@ -80,8 +80,10 @@ following scripting example. $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Clear() # Add an Add-ons menu item with a shortcut and fast access key. -# Note the use of "_" as opposed to the "&" for mapping to the fast access key letter for the menu item. -$menuAdded = $psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add('_Process', {Get-Process}, 'Alt+P') +# Note the use of "_" as opposed to the "&" for mapping to the fast access key letter +# for the menu item. +$menuAdded = $psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add('_Process', + {Get-Process}, 'Alt+P') # Add a nested menu - a parent and a child submenu item. $parentAdded = $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add('Parent', $null, $null) $parentAdded.SubMenus.Add('_Dir', {dir}, 'Alt+D') @@ -89,6 +91,11 @@ $parentAdded.SubMenus.Add('_Dir', {dir}, 'Alt+D') ## See Also -- [The ISEMenuItemCollection Object](The-ISEMenuItemCollection-Object.md) -- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) +- [The ISEMenuItemCollection Object][03] +- [Purpose of the Windows PowerShell ISE Scripting Object Model][01] +- [The ISE Object Model Hierarchy][02] + + +[01]: Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md +[02]: The-ISE-Object-Model-Hierarchy.md +[03]: The-ISEMenuItemCollection-Object.md diff --git a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEMenuItemCollection-Object.md b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEMenuItemCollection-Object.md index 16eed191652f..eafea3c5ad80 100644 --- a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEMenuItemCollection-Object.md +++ b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEMenuItemCollection-Object.md @@ -1,43 +1,39 @@ --- description: An ISEMenuItemCollection object is a collection of ISEMenuItem objects. -ms.date: 10/05/2021 +ms.date: 03/27/2025 title: The ISEMenuItemCollection Object --- # The ISEMenuItemCollection Object -An **ISEMenuItemCollection** object is a collection of **ISEMenuItem** objects. It is an instance of +An **ISEMenuItemCollection** object is a collection of **ISEMenuItem** objects. It's an instance of the **Microsoft.PowerShell.Host.ISE.ISEMenuItemCollection** class. An example is the -`$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus` object that is used to customize the **Add-On** +`$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus` object that's used to customize the **Add-On** menu in Windows PowerShell® Integrated Scripting Environment (ISE). ## Method -### Add\(string DisplayName, System.Management.Automation.ScriptBlock Action, System.Windows.Input.KeyGesture Shortcut \) +### `Add(DisplayName, Action, Shortcut )` Supported in Windows PowerShell ISE 2.0 and later. Adds a menu item to the collection. -**DisplayName** -The display name of the menu to be added. - -**Action** The **System.Management.Automation.ScriptBlock** object that specifies the action that is -associated with this menu item. - -**Shortcut** -The keyboard shortcut for the action. - -**Returns** -The **ISEMenuItem** object that was just added. +- **DisplayName** - String - The display name of the menu to be added. +- **Action** - System.Management.Automation.ScriptBlock - The object that specifies the action + that's associated with this menu item. +- **Shortcut** - System.Windows.Input.KeyGesture - The keyboard shortcut for the action. +- **Returns** - The **ISEMenuItem** object that was just added. ```powershell # Create an Add-ons menu with a fast access key and a shortcut. -# Note the use of "_" as opposed to the "&" for mapping to the fast access key letter for the menu item. -$menuAdded = $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add('_Process', {Get-Process}, 'Alt+P') +# Note the use of "_" as opposed to the "&" for mapping to the fast access key +# letter for the menu item. +$menuAdded = $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add('_Process', + {Get-Process}, 'Alt+P') ``` -### Clear\(\) +### `Clear()` Supported in Windows PowerShell ISE 2.0 and later. @@ -50,6 +46,11 @@ $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Clear() ## See Also -- [The ISEMenuItem Object](The-ISEMenuItem-Object.md) -- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) +- [The ISEMenuItem Object][03] +- [Purpose of the Windows PowerShell ISE Scripting Object Model][01] +- [The ISE Object Model Hierarchy][02] + + +[01]: Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md +[02]: The-ISE-Object-Model-Hierarchy.md +[03]: The-ISEMenuItem-Object.md diff --git a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEOptions-Object.md b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEOptions-Object.md index 19c10ac2f790..53aeb534b6c7 100644 --- a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEOptions-Object.md +++ b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISEOptions-Object.md @@ -1,31 +1,32 @@ --- description: The ISEOptions object represents various settings for Windows PowerShell ISE. -ms.date: 12/31/2019 +ms.date: 03/27/2025 title: The ISEOptions Object --- # The ISEOptions Object -The **ISEOptions** object represents various settings for Windows PowerShell ISE. It is an instance +The **ISEOptions** object represents various settings for Windows PowerShell ISE. It's an instance of the **Microsoft.PowerShell.Host.ISE.ISEOptions** class. The **ISEOptions** object provides the following methods and properties. ## Methods -### RestoreDefaultConsoleTokenColors\(\) +### `RestoreDefaultConsoleTokenColors()` Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. Restores the default values of the token colors in the Console pane. ```powershell -# Changes the color of the commands in the Console pane to red and then restores it to its default value. +# Changes the color of the commands in the Console pane to red and then restores +# it to its default value. $psISE.Options.ConsoleTokenColors["Command"] = 'red' $psISE.Options.RestoreDefaultConsoleTokenColors() ``` -### RestoreDefaults\(\) +### `RestoreDefaults()` Supported in Windows PowerShell ISE 2.0 and later. @@ -39,27 +40,29 @@ $psISE.Options.ConsolePaneBackgroundColor = 'orange' $psISE.Options.RestoreDefaults() ``` -### RestoreDefaultTokenColors\(\) +### `RestoreDefaultTokenColors()` Supported in Windows PowerShell ISE 2.0 and later. Restores the default values of the token colors in the Script pane. ```powershell -# Changes the color of the comments in the Script pane to red and then restores it to its default value. +# Changes the color of the comments in the Script pane to red and then restores it +# to its default value. $psISE.Options.TokenColors["Comment"] = 'red' $psISE.Options.RestoreDefaultTokenColors() ``` -### RestoreDefaultXmlTokenColors\(\) +### `RestoreDefaultXmlTokenColors()` Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. Restores the default values of the token colors for XML elements that are displayed in Windows -PowerShell ISE. Also see [XmlTokenColors](#xmltokencolors). +PowerShell ISE. Also see [XmlTokenColors][09]. ```powershell -# Changes the color of the comments in XML data to red and then restores it to its default value. +# Changes the color of the comments in XML data to red and then restores it +# to its default value. $psISE.Options.XmlTokenColors["Comment"] = 'red' $psISE.Options.RestoreDefaultXmlTokenColors() ``` @@ -81,9 +84,9 @@ $psISE.Options.AutoSaveMinuteInterval = 3 ### CommandPaneBackgroundColor This feature is present in Windows PowerShell ISE 2.0, but was removed or renamed in later versions -of the ISE. For later versions, see [ConsolePaneBackgroundColor](#consolepanebackgroundcolor). +of the ISE. For later versions, see [ConsolePaneBackgroundColor][01]. -Specifies the background color for the Command pane. It is an instance of the +Specifies the background color for the Command pane. It's an instance of the **System.Windows.Media.Color** class. ```powershell @@ -107,7 +110,7 @@ $psISE.Options.CommandPaneUp = $true Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -Specifies the background color for the Console pane. It is an instance of the +Specifies the background color for the Console pane. It's an instance of the **System.Windows.Media.Color** class. ```powershell @@ -143,11 +146,12 @@ Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier ve Specifies the colors of the IntelliSense tokens in the Windows PowerShell ISE Console pane. This property is a dictionary object that contains name/value pairs of token types and colors for the -Console pane. To change the colors of the IntelliSense tokens in the Script pane, see [TokenColors](#tokencolors). -To reset the colors to the default values, see [RestoreDefaultConsoleTokenColors](#restoredefaultconsoletokencolors). -Token colors can be set for the following: Attribute, Command, CommandArgument, CommandParameter, -Comment, GroupEnd, GroupStart, Keyword, LineContinuation, LoopLabel, Member, NewLine, Number, -Operator, Position, StatementSeparator, String, Type, Unknown, Variable. +Console pane. To change the colors of the IntelliSense tokens in the Script pane, see +[TokenColors][08]. To reset the colors to the default values, see +[RestoreDefaultConsoleTokenColors][05]. Token colors can be set for the following: Attribute, +Command, CommandArgument, CommandParameter, Comment, GroupEnd, GroupStart, Keyword, +LineContinuation, LoopLabel, Member, NewLine, Number, Operator, Position, StatementSeparator, +String, Type, Unknown, Variable. ```powershell # Sets the color of commands to green. @@ -160,11 +164,12 @@ $psISE.Options.ConsoleTokenColors["Keyword"] = 'magenta' Supported in Windows PowerShell ISE 2.0 and later. -Specifies the background color for the debug text that appears in the Console pane. It is an -instance of the **System.Windows.Media.Color** class. +Specifies the background color for the debug text that appears in the Console pane. It's an instance +of the **System.Windows.Media.Color** class. ```powershell -# Changes the background color for the debug text that appears in the Console pane to blue. +# Changes the background color for the debug text that appears in the Console pane +# to blue. $psISE.Options.DebugBackgroundColor = '#0000FF' ``` @@ -172,11 +177,12 @@ $psISE.Options.DebugBackgroundColor = '#0000FF' Supported in Windows PowerShell ISE 2.0 and later. -Specifies the foreground color for the debug text that appears in the Console pane. It is an -instance of the **System.Windows.Media.Color** class. +Specifies the foreground color for the debug text that appears in the Console pane. It's an instance +of the **System.Windows.Media.Color** class. ```powershell -# Changes the foreground color for the debug text that appears in the Console pane to yellow. +# Changes the foreground color for the debug text that appears in the Console +# pane to yellow. $psISE.Options.DebugForegroundColor = 'yellow' ``` @@ -184,7 +190,8 @@ $psISE.Options.DebugForegroundColor = 'yellow' Supported in Windows PowerShell ISE 2.0 and later. -A collection of properties that specify the default values to be used when the Reset methods are used. +A collection of properties that specify the default values to be used when the Reset methods are +used. ```powershell # Displays the name of the default options. This example is from ISE 4.0. @@ -233,7 +240,7 @@ IntellisenseTimeoutInSeconds : 3 Supported in Windows PowerShell ISE 2.0 and later. -Specifies the background color for error text that appears in the Console pane. It is an instance of +Specifies the background color for error text that appears in the Console pane. It's an instance of the **System.Windows.Media.Color** class. ```powershell @@ -245,7 +252,7 @@ $psISE.Options.ErrorBackgroundColor = 'black' Supported in Windows PowerShell ISE 2.0 and later. -Specifies the foreground color for error text that appears in the Console pane. It is an instance of +Specifies the foreground color for error text that appears in the Console pane. It's an instance of the **System.Windows.Media.Color** class. ```powershell @@ -268,7 +275,7 @@ $psISE.Options.FontName = 'Courier New' Supported in Windows PowerShell ISE 2.0 and later. -Specifies the font size as an integer. It is used in the Script pane, the Command pane, and the +Specifies the font size as an integer. It's used in the Script pane, the Command pane, and the Output pane. The valid range of values is 8 through 32. ```powershell @@ -297,16 +304,17 @@ Specifies the number of recently opened files that Windows PowerShell ISE tracks bottom of the **File Open** menu. The default value is 10. The value is an integer. ```powershell -# Changes the number of recently used files that appear at the bottom of the File Open menu to 5. +# Changes the number of recently used files that appear at the bottom of the +# File Open menu to 5. $psISE.Options.MruCount = 5 ``` ### OutputPaneBackgroundColor This feature is present in Windows PowerShell ISE 2.0, but was removed or renamed in later versions -of the ISE. For later versions, see [ConsolePaneBackgroundColor](#consolepanebackgroundcolor). +of the ISE. For later versions, see [ConsolePaneBackgroundColor][01]. -The read/write property that gets or sets the background color for the Output pane itself. It is an +The read/write property that gets or sets the background color for the Output pane itself. It's an instance of the **System.Windows.Media.Color** class. ```powershell @@ -317,7 +325,7 @@ $psISE.Options.OutputPaneForegroundColor = 'gold' ### OutputPaneTextForegroundColor This feature is present in Windows PowerShell ISE 2.0, but was removed or renamed in later versions -of the ISE. For later versions, see [ConsolePaneForegroundColor](#consolepaneforegroundcolor). +of the ISE. For later versions, see [ConsolePaneForegroundColor][02]. The read/write property that changes the foreground color of the text in the Output pane in Windows PowerShell ISE 2.0. @@ -330,7 +338,7 @@ $psISE.Options.OutputPaneTextForegroundColor = 'blue' ### OutputPaneTextBackgroundColor This feature is present in Windows PowerShell ISE 2.0, but was removed or renamed in later versions -of the ISE. For later versions, see [ConsolePaneTextBackgroundColor](#consolepanetextbackgroundcolor). +of the ISE. For later versions, see [ConsolePaneTextBackgroundColor][03]. The read/write property that changes the background color of the text in the Output pane. @@ -343,7 +351,7 @@ $psISE.Options.OutputPaneTextBackgroundColor = 'pink' Supported in Windows PowerShell ISE 2.0 and later. -The read/write property that gets or sets the background color for files. It is an instance of the +The read/write property that gets or sets the background color for files. It's an instance of the **System.Windows.Media.Color** class. ```powershell @@ -355,8 +363,8 @@ $psISE.Options.ScriptPaneBackgroundColor = 'yellow' Supported in Windows PowerShell ISE 2.0 and later. -The read/write property that gets or sets the foreground color for non-script files in the Script pane. -To set the foreground color for script files, use the [TokenColors](#tokencolors). +The read/write property that gets or sets the foreground color for non-script files in the Script +pane. To set the foreground color for script files, use the [TokenColors][08]. ```powershell # Sets the foreground to color of non-script files in the script pane to green. @@ -383,9 +391,9 @@ $psISE.Options.SelectedScriptPaneState = 'Maximized' Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -Specifies whether the CTRL+J list of snippets includes the starter set that is included in -Windows PowerShell. When set to `$false`, only user-defined snippets appear in the CTRL+J list. -The default value is `$true`. +Specifies whether the CTRL+J list of snippets includes the starter set that's +included in Windows PowerShell. When set to `$false`, only user-defined snippets appear in the +CTRL+J list. The default value is `$true`. ```powershell # Hide the default snippets from the CTRL+J list. @@ -420,7 +428,8 @@ $psISE.Options.ShowIntellisenseInScriptPane = $false Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -Specifies whether the Script pane displays line numbers in the left margin. The default value is `$true`. +Specifies whether the Script pane displays line numbers in the left margin. The default value is +`$true`. ```powershell # Turn off line numbers in the Script pane. @@ -432,9 +441,9 @@ $psISE.Options.ShowLineNumbers = $false Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. Specifies whether the Script pane displays expandable and collapsible brackets next to sections of -code in the left margin. When they are displayed, you can click the minus `-` icons next to a -block of text to collapse it or click the plus `+` icon to expand a block of text. The default -value is `$true`. +code in the left margin. When they're displayed, you can click the minus `-` icons next to a block +of text to collapse it or click the plus `+` icon to expand a block of text. The default value is +`$true`. ```powershell # Turn off outlining in the Script pane. @@ -457,7 +466,7 @@ $psISE.Options.ShowToolBar = $true Supported in Windows PowerShell ISE 2.0 and later. -Specifies whether a warning message appears when a script is saved automatically before it is run. +Specifies whether a warning message appears when a script is saved automatically before it's run. The default value is `$true`. ```powershell @@ -487,11 +496,12 @@ Supported in Windows PowerShell ISE 2.0 and later. Specifies the colors of the IntelliSense tokens in the Windows PowerShell ISE Script pane. This property is a dictionary object that contains name/value pairs of token types and colors for the -Script pane. To change the colors of the IntelliSense tokens in the Console pane, see [ConsoleTokenColors](#consoletokencolors). -To reset the colors to the default values, see [RestoreDefaultTokenColors](#restoredefaulttokencolors). -Token colors can be set for the following: Attribute, Command, CommandArgument, CommandParameter, -Comment, GroupEnd, GroupStart, Keyword, LineContinuation, LoopLabel, Member, NewLine, Number, -Operator, Position, StatementSeparator, String, Type, Unknown, Variable. +Script pane. To change the colors of the IntelliSense tokens in the Console pane, see +[ConsoleTokenColors][04]. To reset the colors to the default values, see +[RestoreDefaultTokenColors][06]. Token colors can be set for the following: Attribute, Command, +CommandArgument, CommandParameter, Comment, GroupEnd, GroupStart, Keyword, LineContinuation, +LoopLabel, Member, NewLine, Number, Operator, Position, StatementSeparator, String, Type, Unknown, +Variable. ```powershell # Sets the color of commands to green. @@ -544,7 +554,7 @@ $psISE.Options.UseLocalHelp = $true Supported in Windows PowerShell ISE 2.0 and later. -Specifies the background color for verbose text that appears in the Console pane. It is a +Specifies the background color for verbose text that appears in the Console pane. It's a **System.Windows.Media.Color** object. ```powershell @@ -556,7 +566,7 @@ $psISE.Options.VerboseBackgroundColor ='#0000FF' Supported in Windows PowerShell ISE 2.0 and later. -Specifies the foreground color for verbose text that appears in the Console pane. It is a +Specifies the foreground color for verbose text that appears in the Console pane. It's a **System.Windows.Media.Color** object. ```powershell @@ -568,7 +578,7 @@ $psISE.Options.VerboseForegroundColor = 'yellow' Supported in Windows PowerShell ISE 2.0 and later. -Specifies the background color for warning text that appears in the Console pane. It is a +Specifies the background color for warning text that appears in the Console pane. It's a **System.Windows.Media.Color** object. ```powershell @@ -580,7 +590,7 @@ $psISE.Options.WarningBackgroundColor = '#0000FF' Supported in Windows PowerShell ISE 2.0 and later. -Specifies the foreground color for warning text that appears in the Output pane. It is a +Specifies the foreground color for warning text that appears in the Output pane. It's a **System.Windows.Media.Color** object. ```powershell @@ -593,10 +603,10 @@ $psISE.Options.WarningForegroundColor = 'yellow' Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. Specifies a dictionary object that contains name/value pairs of token types and colors for XML -content that is displayed in Windows PowerShell ISE. Token colors can be set for the following: +content that's displayed in Windows PowerShell ISE. Token colors can be set for the following: Attribute, Command, CommandArgument, CommandParameter, Comment, GroupEnd, GroupStart, Keyword, LineContinuation, LoopLabel, Member, NewLine, Number, Operator, Position, StatementSeparator, -String, Type, Unknown, Variable. Also see [RestoreDefaultXmlTokenColors](#restoredefaultxmltokencolors). +String, Type, Unknown, Variable. Also see [RestoreDefaultXmlTokenColors][07]. ```powershell # Sets the color of XML element names to green. @@ -620,5 +630,18 @@ $psISE.Options.Zoom = 200 ## See Also -- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) +- [Purpose of the Windows PowerShell ISE Scripting Object Model][10] +- [The ISE Object Model Hierarchy][11] + + +[01]: #consolepanebackgroundcolor +[02]: #consolepaneforegroundcolor +[03]: #consolepanetextbackgroundcolor +[04]: #consoletokencolors +[05]: #restoredefaultconsoletokencolors +[06]: #restoredefaulttokencolors +[07]: #restoredefaultxmltokencolors +[08]: #tokencolors +[09]: #xmltokencolors +[10]: Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md +[11]: The-ISE-Object-Model-Hierarchy.md diff --git a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISESnippetCollection-Object.md b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISESnippetCollection-Object.md index b9441da9ab4b..83e1fe21841f 100644 --- a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISESnippetCollection-Object.md +++ b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISESnippetCollection-Object.md @@ -1,35 +1,45 @@ --- -description: The ISESnippetCollection object is a collection of ISESnippet objects. The files collection that is associated with a PowerShellTab object is a member of this class. -ms.date: 12/31/2019 +description: The ISESnippetCollection object is a collection of ISESnippet objects. The files collection that's associated with a PowerShellTab object is a member of this class. +ms.date: 03/27/2025 title: The ISESnippetCollection Object --- # The ISESnippetCollection Object The **ISESnippetCollection** object is a collection of **ISESnippet** objects. The files collection -that is associated with a **PowerShellTab** object is a member of this class. An example is the +that's associated with a **PowerShellTab** object is a member of this class. An example is the `$psISE.CurrentPowerShellTab.Files` collection. ## Methods -### Load\( FilePathName \) +### `Load( FilePathName )` Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. Loads a `snippets.ps1xml` file that contains user-defined snippets. The easiest way to create -snippets is to use the `New-IseSnippet` cmdlet, which automatically stores them in your profile folder -so that they are loaded every time that you start Windows PowerShell ISE. +snippets is to use the `New-IseSnippet` cmdlet, which automatically stores them in your profile +folder so that they're loaded every time that you start Windows PowerShell ISE. -**FilePathName** - String -The path and file name to a `snippets.ps1xml` file that contains snippet definitions. +- **FilePathName** - String - The path and file name to a `snippets.ps1xml` file that contains + snippet definitions. ```powershell # Loads a custom snippet file into the current PowerShell tab. -$SnipFile = Join-Path ( Split-Path $PROFILE) 'Snippets\MySnips.snippets.ps1xml' $psISE.CurrentPowerShellTab.Snippets.Add($SnipPath) +$joinPathSplat = @{ + Path = ( Split-Path $PROFILE) + ChildPath = 'Snippets\MySnips.snippets.ps1xml' + AdditionalChildPath = $psISE.CurrentPowerShellTab.Snippets.Add($SnipPath) +} +$SnipFile = Join-Path @joinPathSplat ``` ## See Also -- [The ISESnippetObject](The-ISESnippetObject.md) -- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) +- [The ISESnippetObject][03] +- [Purpose of the Windows PowerShell ISE Scripting Object Model][01] +- [The ISE Object Model Hierarchy][02] + + +[01]: Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md +[02]: The-ISE-Object-Model-Hierarchy.md +[03]: The-ISESnippetObject.md diff --git a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISESnippetObject.md b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISESnippetObject.md index fdaf28848a7e..426f34f249b1 100644 --- a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISESnippetObject.md +++ b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ISESnippetObject.md @@ -1,6 +1,6 @@ --- description: An ISESnippet object is an instance of the Microsoft.PowerShell.Host.ISE.ISESnippet class. -ms.date: 06/05/2017 +ms.date: 03/27/2025 title: The ISESnippetObject --- @@ -8,8 +8,7 @@ title: The ISESnippetObject An **ISESnippet** object is an instance of the Microsoft.PowerShell.Host.ISE.ISESnippet class. The members of the `$psISE.CurrentPowerShellTab.Snippets` collection are all examples of **ISESnippet** -objects. The easiest way to create a snippet is to use the -[New-IseSnippet](/powershell/module/ISE/New-IseSnippet) cmdlet. +objects. The easiest way to create a snippet is to use the [New-IseSnippet][01] cmdlet. ## Properties @@ -50,6 +49,12 @@ $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus[0].Shortcut ## See Also -- [The ISESnippetCollection Object](The-ISESnippetCollection-Object.md) -- [Purpose of the Windows PowerShell ISE Scripting Object Model](purpose-of-the-windows-powershell-ise-scripting-object-model.md) -- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) +- [The ISESnippetCollection Object][04] +- [Purpose of the Windows PowerShell ISE Scripting Object Model][02] +- [The ISE Object Model Hierarchy][03] + + +[01]: /powershell/module/ISE/New-IseSnippet +[02]: purpose-of-the-windows-powershell-ise-scripting-object-model.md +[03]: The-ISE-Object-Model-Hierarchy.md +[04]: The-ISESnippetCollection-Object.md diff --git a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ObjectModelRoot-Object.md b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ObjectModelRoot-Object.md index 4423672f3c6b..4989998d4bdc 100644 --- a/reference/docs-conceptual/windows-powershell/ise/object-model/The-ObjectModelRoot-Object.md +++ b/reference/docs-conceptual/windows-powershell/ise/object-model/The-ObjectModelRoot-Object.md @@ -1,12 +1,12 @@ --- description: The $psISE object, which is the principal root object in PowerShell ISE is an instance of the Microsoft.PowerShell.Host.ISE.ObjectModelRoot class. This topic describes the properties of the ObjectModelRoot object. -ms.date: 08/25/2017 +ms.date: 03/27/2025 title: The ObjectModelRoot Object --- # The ObjectModelRoot Object -The `$psISE` object, which is the principal root object in Windows PowerShell® Integrated Scripting +The `$psISE` object, which is the principal root object in Windows PowerShell Integrated Scripting Environment (ISE) is an instance of the Microsoft.PowerShell.Host.ISE.ObjectModelRoot class. This topic describes the properties of the **ObjectModelRoot** object. @@ -29,15 +29,14 @@ The read-only property that gets the PowerShell tab that has the focus. > Supported in Windows PowerShell ISE 2.0 and later. -The read-only property that gets the currently visible -Windows PowerShell ISE add-on tool that is located in -the horizontal tool pane at the bottom of the editor. +The read-only property that gets the currently visible Windows PowerShell ISE add-on tool that's +located in the horizontal tool pane at the bottom of the editor. ### CurrentVisibleVerticalTool > Supported in Windows PowerShell ISE 2.0 and later. -The read-only property that gets the currently visible Windows PowerShell ISE add-on tool that is +The read-only property that gets the currently visible Windows PowerShell ISE add-on tool that's located in the vertical tool pane on the right side of the editor. ### Options @@ -57,5 +56,9 @@ PowerShell tabs to this object by using scripts or by using the menus in Windows ## See Also -- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) +- [Purpose of the Windows PowerShell ISE Scripting Object Model][01] +- [The ISE Object Model Hierarchy][02] + + +[01]: Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md +[02]: The-ISE-Object-Model-Hierarchy.md diff --git a/reference/docs-conceptual/windows-powershell/ise/object-model/The-PowerShellTab-Object.md b/reference/docs-conceptual/windows-powershell/ise/object-model/The-PowerShellTab-Object.md index 5a86a62af581..18bd4fc26c5e 100644 --- a/reference/docs-conceptual/windows-powershell/ise/object-model/The-PowerShellTab-Object.md +++ b/reference/docs-conceptual/windows-powershell/ise/object-model/The-PowerShellTab-Object.md @@ -1,6 +1,6 @@ --- description: The PowerShellTab object represents a Windows PowerShell runtime environment. -ms.date: 06/05/2017 +ms.date: 03/27/2025 title: The PowerShellTab Object --- @@ -10,19 +10,18 @@ The **PowerShellTab** object represents a Windows PowerShell runtime environment ## Methods -### Invoke\( Script \) +### `Invoke( Script )` Supported in Windows PowerShell ISE 2.0 and later. Runs the given script in the PowerShell tab. > [!NOTE] -> This method only works on other PowerShell tabs, not the PowerShell tab from which it is run. It -> does not return any object or value. If the code modifies any variable, then those changes persist +> This method only works on other PowerShell tabs, not the PowerShell tab from which it's run. It +> doesn't return any object or value. If the code modifies any variable, then those changes persist > on the tab against which the command was invoked. -**Script** - System.Management.Automation.ScriptBlock or String -The script block to run. +- **Script** - System.Management.Automation.ScriptBlock or String - The script block to run. ```powershell # Manually create a second PowerShell tab before running this script. @@ -30,29 +29,26 @@ The script block to run. $psISE.PowerShellTabs[1].Invoke({dir}) ``` -### InvokeSynchronous\( Script, \[useNewScope\], millisecondsTimeout \) +### `InvokeSynchronous( Script, [useNewScope], millisecondsTimeout )` Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. Runs the given script in the PowerShell tab. > [!NOTE] -> This method only works on other PowerShell tabs, not the PowerShell tab from which it is run. The -> script block is run and any value that is returned from the script is returned to the run +> This method only works on other PowerShell tabs, not the PowerShell tab from which it's run. The +> script block is run and any value that's returned from the script is returned to the run > environment from which you invoked the command. If the command takes longer to run than the > **millesecondsTimeout** value specifies, then the command fails with an exception: "The operation > has timed out." -**Script** - System.Management.Automation.ScriptBlock or String -The script block to run. - -**\[useNewScope\]** - Optional Boolean that defaults to `$true` -If set to `$true`, then a new scope is created within which to run the command. It does not modify -the runtime environment of the PowerShell tab that is specified by the command. - -**\[millisecondsTimeout\]** - Optional integer that defaults to **500**. -If the command does not finish within the specified time, then the command generates a -**TimeoutException** with the message "The operation has timed out." +- **Script** - System.Management.Automation.ScriptBlock or String - The script block to run. +- **[useNewScope]** - Optional Boolean that defaults to `$true` - If set to `$true`, then a new + scope is created within which to run the command. It doesn't modify the runtime environment of the + PowerShell tab that's specified by the command. +- **[millisecondsTimeout]** - Optional integer that defaults to **500**. - If the command doesn't + finish within the specified time, then the command generates a **TimeoutException** with the + message "The operation has timed out." ```powershell # Create a new PowerShell tab and then switch back to the first @@ -86,7 +82,8 @@ The read-only property that gets the Add-ons menu for the PowerShell tab. $psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Clear() # Create an AddOns menu with an accessor. # Note the use of "_" as opposed to the "&" for mapping to the fast key letter for the menu item. -$menuAdded = $psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add('_Process', {Get-Process}, 'Alt+P') +$menuAdded = $psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add('_Process', + {Get-Process}, 'Alt+P') # Add a nested menu. $parentAdded = $psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add('Parent', $null, $null) $parentAdded.SubMenus.Add('_Dir', {dir}, 'Alt+D') @@ -98,13 +95,13 @@ $psISE.CurrentPowerShellTab.AddOnsMenu Supported in Windows PowerShell ISE 2.0 and later. -The read-only Boolean property that returns a `$true` value if a script can be invoked with the [Invoke( Script )](#invoke-script-) -method. +The read-only Boolean property that returns a `$true` value if a script can be invoked with the +[Invoke( Script )][01] method. ```powershell # CanInvoke will be false if the PowerShell # tab is running a script that takes a while, and you -# check its properties from another PowerShell tab. It is +# check its properties from another PowerShell tab. It's # always false if checked on the current PowerShell tab. # Manually create a second PowerShell tab before running this script. # Return to the first tab and type @@ -119,7 +116,7 @@ $secondTab.CanInvoke Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. In Windows PowerShell ISE 2.0 this was named **CommandPane**. -The read-only property that gets the Console pane [editor](The-ISEEditor-Object.md) object. +The read-only property that gets the Console pane [editor][04] object. ```powershell # Gets the Console Pane editor. @@ -130,7 +127,7 @@ $psISE.CurrentPowerShellTab.ConsolePane Supported in Windows PowerShell ISE 2.0 and later. -The read-write property that gets or sets the text that is displayed on the PowerShell tab. By +The read-write property that gets or sets the text that's displayed on the PowerShell tab. By default, tabs are named "PowerShell #", where the # represents a number. ```powershell @@ -154,8 +151,8 @@ $psISE.CurrentPowerShellTab.ExpandedScript = !$psISE.CurrentPowerShellTab.Expand Supported in Windows PowerShell ISE 2.0 and later. -The read-only property that gets the [collection of script files](The-ISEFileCollection-Object.md) -that are open in the PowerShell tab. +The read-only property that gets the [collection of script files][05] that are open in the +PowerShell tab. ```powershell $newFile = $psISE.CurrentPowerShellTab.Files.Add() @@ -170,7 +167,7 @@ This feature is present in Windows PowerShell ISE 2.0, but was removed or rename of the ISE. In later versions of Windows PowerShell ISE, you can use the **ConsolePane** object for the same purposes. -The read-only property that gets the Output pane of the current [editor](The-ISEEditor-Object.md). +The read-only property that gets the Output pane of the current [editor][04]. ```powershell # Clears the text in the Output pane. @@ -181,8 +178,8 @@ $psISE.CurrentPowerShellTab.Output.Clear() Supported in Windows PowerShell ISE 2.0 and later. -The read-only property that gets the current prompt text. Note: the **prompt** function can be -overridden by the user'™s profile. If the result is other than a simple string, then this property +The read-only property that gets the current prompt text. Note: the `prompt` function can be +overridden by the user's profile. If the result is other than a simple string, then this property returns nothing. ```powershell @@ -240,6 +237,14 @@ $psISE.CurrentPowerShellTab.HorizontalAddOnToolsPaneOpened ## See Also -- [The PowerShellTabCollection Object](The-PowerShellTabCollection-Object.md) -- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) +- [The PowerShellTabCollection Object][06] +- [Purpose of the Windows PowerShell ISE Scripting Object Model][02] +- [The ISE Object Model Hierarchy][03] + + +[01]: #invoke-script- +[02]: Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md +[03]: The-ISE-Object-Model-Hierarchy.md +[04]: The-ISEEditor-Object.md +[05]: The-ISEFileCollection-Object.md +[06]: The-PowerShellTabCollection-Object.md diff --git a/reference/docs-conceptual/windows-powershell/ise/object-model/The-PowerShellTabCollection-Object.md b/reference/docs-conceptual/windows-powershell/ise/object-model/The-PowerShellTabCollection-Object.md index c1f55c291427..51be20ba5caa 100644 --- a/reference/docs-conceptual/windows-powershell/ise/object-model/The-PowerShellTabCollection-Object.md +++ b/reference/docs-conceptual/windows-powershell/ise/object-model/The-PowerShellTabCollection-Object.md @@ -1,18 +1,18 @@ --- description: The PowerShellTab collection object is a collection of PowerShellTab objects. Each PowerShellTab object functions as a separate runtime environment. -ms.date: 06/05/2017 +ms.date: 03/27/2025 title: The PowerShellTabCollection Object --- # The PowerShellTabCollection Object The **PowerShellTab** collection object is a collection of **PowerShellTab** objects. Each -**PowerShellTab** object functions as a separate runtime environment. It is an instance of +**PowerShellTab** object functions as a separate runtime environment. It's an instance of Microsoft.PowerShell.Host.ISE.PowerShellTabs class. An example is the `$psISE.PowerShellTabs` object. ## Methods -### Add\(\) +### `Add()` Supported in Windows PowerShell ISE 2.0 and later. @@ -23,14 +23,13 @@ $newTab = $psISE.PowerShellTabs.Add() $newTab.DisplayName = 'Brand New Tab' ``` -### Remove\(Microsoft.PowerShell.Host.ISE.PowerShellTab psTab\) +### `Remove(Microsoft.PowerShell.Host.ISE.PowerShellTab psTab)` Supported in Windows PowerShell ISE 2.0 and later. -Removes the tab that is specified by the **psTab** parameter. +Removes the tab that's specified by the **psTab** parameter. -**psTab** -The PowerShell tab to remove. +- **psTab** - The PowerShell tab to remove. ```powershell $newTab = $psISE.PowerShellTabs.Add() @@ -40,15 +39,14 @@ sleep 5 $psISE.PowerShellTabs.Remove($newTab) ``` -### SetSelectedPowerShellTab\(Microsoft.PowerShell.Host.ISE.PowerShellTab psTab\) +### `SetSelectedPowerShellTab(Microsoft.PowerShell.Host.ISE.PowerShellTab psTab)` Supported in Windows PowerShell ISE 2.0 and later. -Selects the PowerShell tab that is specified by the **psTab** parameter to make it the currently +Selects the PowerShell tab that's specified by the **psTab** parameter to make it the currently active PowerShell tab. -**psTab** -The PowerShell tab to select. +- **psTab** - The PowerShell tab to select. ```powershell # Save the current tab in a variable and rename it @@ -63,6 +61,11 @@ $psISE.PowerShellTabs.SelectedPowerShellTab = $oldTab ## See Also -- [The PowerShellTab Object](The-PowerShellTab-Object.md) -- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) +- [The PowerShellTab Object][03] +- [Purpose of the Windows PowerShell ISE Scripting Object Model][01] +- [The ISE Object Model Hierarchy][02] + + +[01]: Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md +[02]: The-ISE-Object-Model-Hierarchy.md +[03]: The-PowerShellTab-Object.md diff --git a/reference/docs-conceptual/windows-powershell/wmf-overview.md b/reference/docs-conceptual/windows-powershell/wmf-overview.md index 4e866776c7bb..dbbdb7a40963 100644 --- a/reference/docs-conceptual/windows-powershell/wmf-overview.md +++ b/reference/docs-conceptual/windows-powershell/wmf-overview.md @@ -1,6 +1,6 @@ --- -description: WMF is a prerequisite for Windows PowerShell. This articles shows the history of WMF versions and provides information about how to find and install WMF. -ms.date: 11/03/2023 +description: WMF is a prerequisite for Windows PowerShell. This article shows the history of WMF versions and provides information about how to find and install WMF. +ms.date: 03/27/2025 ms.topic: overview title: Windows Management Framework (WMF) --- @@ -29,8 +29,8 @@ WMF installation adds and/or updates the following features: ## WMF Release Notes -To learn about various enhancements in PowerShell and other components of a given WMF, please refer -to the links below to review the release notes: +To learn about the enhancements in Windows PowerShell and other components, see the release notes +for each version of WMF: - [WMF 5.1][08] - [WMF 5.0][07] @@ -57,8 +57,8 @@ to the links below to review the release notes: - **Included**: The features of the specified version of WMF were shipped in the indicated version of Windows client or Windows Server. -- **Out of support**: These products are no longer supported by Microsoft. You must upgrade to a - supported version. For more information, see the [Microsoft Lifecycle Policy][06] page. +- **Out of support**: Microsoft no longer supports these products. You must upgrade to a supported + version. For more information, see the [Microsoft Lifecycle Policy][06] page. > [!NOTE] > The version of WMF that shipped in an operating system is supported for the lifetime of support diff --git a/xx.ps1 b/xx.ps1 new file mode 100644 index 000000000000..5f282702bb03 --- /dev/null +++ b/xx.ps1 @@ -0,0 +1 @@ + \ No newline at end of file