共用方式為


PowerShellTabCollection 物件

PowerShellTab 集合物件是一組 PowerShellTab 物件。 每個 PowerShellTab 物件都作為獨立的執行環境運作。 它是 Microsoft.PowerShell.Host.ISE.PowerShellTabs 類別的一個實例。 例如物件。$psISE.PowerShellTabs

Methods

Add()

支援於 Windows PowerShell ISE 2.0 及更新版本。

新增一個 PowerShell 標籤頁到集合中。 它會回傳新加入的分頁。

$newTab = $psISE.PowerShellTabs.Add()
$newTab.DisplayName = 'Brand New Tab'

Remove(Microsoft.PowerShell.Host.ISE.PowerShellTab psTab)

支援於 Windows PowerShell ISE 2.0 及更新版本。

移除由 psTab 參數指定的分頁。

  • psTab - 用來移除的 PowerShell 分頁。
$newTab = $psISE.PowerShellTabs.Add()
Change the DisplayName of the new PowerShell tab.
$newTab.DisplayName = 'This tab will go away in 5 seconds'
sleep 5
$psISE.PowerShellTabs.Remove($newTab)

SetSelectedPowerShellTab(Microsoft.PowerShell.Host.ISE.PowerShellTab psTab)

支援於 Windows PowerShell ISE 2.0 及更新版本。

選擇由 psTab 參數指定的 PowerShell 分頁,使其成為目前啟用的 PowerShell 分頁。

  • psTab - 選擇 PowerShell 分頁。
# Save the current tab in a variable and rename it
$oldTab = $psISE.CurrentPowerShellTab
$psISE.CurrentPowerShellTab.DisplayName = 'Old Tab'
# Create a new tab and give it a new display name
$newTab = $psISE.PowerShellTabs.Add()
$newTab.DisplayName = 'Brand New Tab'
# Switch back to the original tab
$psISE.PowerShellTabs.SelectedPowerShellTab = $oldTab

另請參閱