PoshCode Archive  Artifact Content

Artifact 37b469a24bc11617f2006790d42710a14c5e19693a2681d209dbb94ed3581c29:

  • File Update-ISETabs.ps1 — part of check-in [fae9168895] at 2018-06-10 13:20:49 on branch trunk — Reloads all the file tabs in ISE (PS3CTP2) (user: Joel Bennett size: 762)

# encoding: ascii
# api: powershell
# title: Update-ISETabs
# description: Reloads all the file tabs in ISE (PS3CTP2)
# version: 0.1
# author: Joel Bennett
# license: CC0
# x-poshcode-id: 3135
# x-archived: 2012-01-11T06:37:15
# x-published: 2012-12-30T16:45:00
#
#
foreach($tab in $psISE.PowerShellTabs) {
   foreach($file in $tab.Files) {
      $position = Select-Object -InputObject $file.Editor -Property CaretLine, CaretColumn
      $content = Get-Content $file.FullPath -Raw
      if($content -ne $file.Editor.Text) {
         $file.Editor.Text = Get-Content $file.FullPath -Raw
         Write-Verbose "Updated $($file.DisplayName)"
         $file.Editor.SetCaretPosition( $Position.CaretLine, $Position.CaretColumn )
      }
   }
}