PoshCode Logo PowerShell Code Repository

New-IseFile by Bernd Kriszio 24 months ago
embed code: <script type="text/javascript" src="http://PoshCode.org/embed/1618"></script>download | new post

If you are using ISE put this file anywhere into your PATH and functions depending on it can use it. . . Require-Function New-ISEFile
$a = New-ISEFile

  1. you find Require-Function in http://poshcode.org/1617

  1. function New-IseFile ($path = 'tmp_default.ps1')
  2. {
  3.     $count   = $psise.CurrentPowerShellTab.Files.count
  4.     $null    = $psIse.CurrentPowerShellTab.Files.Add()
  5.     $Newfile = $psIse.CurrentPowerShellTab.Files[$count]
  6.     $NewFile.SaveAs($path)
  7.     $NewFile.Save([Text.Encoding]::default)
  8.     $Newfile
  9.  
  10. }

Submit a correction or amendment below (
click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:


Remember me