# encoding: ascii
# api: powershell
# title: New-IseFile
# description: If you are using ISE put this file anywhere into your PATH and functions depending on it can use it.
# version: 0.1
# type: function
# license: CC0
# function: New-IseFile
# x-poshcode-id: 1618
# x-archived: 2010-02-03T16:13:36
#
# . . Require-Function New-ISEFile
# $a = New-ISEFile
# you find Require-Function in http://poshcode.org/1617
#
function New-IseFile ($path = 'tmp_default.ps1')
{
$count = $psise.CurrentPowerShellTab.Files.count
$null = $psIse.CurrentPowerShellTab.Files.Add()
$Newfile = $psIse.CurrentPowerShellTab.Files[$count]
$NewFile.SaveAs($path)
$NewFile.Save([Text.Encoding]::default)
$Newfile
}