# 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 )
      }
   }
}
