PoshCode Archive  Artifact [0f6214b460]

Artifact 0f6214b460072b3620affcc20f3aed58c298431c24f5349b8822795ad4af63a9:

  • File New-IseFile.ps1 — part of check-in [77ce5299bf] at 2018-06-10 12:59:15 on branch trunk — If you are using ISE put this file anywhere into your PATH and functions depending on it can use it. (user: unknown size: 746)

# 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

}