PoshCode Archive  Artifact [38351e2596]

Artifact 38351e2596498ae53c7d1afa84a99e137791c3f713347245d15bfbdb96bd6c59:

  • File Write-IseFile.ps1 — part of check-in [02bb3fea84] at 2018-06-10 12:59:16 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: 676)

# encoding: ascii
# api: powershell
# title: Write-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: Write-IseFile
# x-poshcode-id: 1619
# x-archived: 2010-02-03T15:55:54
#
# .  . Require-Function Write-IseFile
# $a = New-ISEFile
# Write-ISEFile $a ‘This line will neither be wrapped nor truncated’
# you find Require-Function in  http://poshcode.org/1617
#
function Write-IseFile($file, $msg)
{
    $Editor = $file.Editor
    $Editor.SetCaretPosition($Editor.LineCount, 1)
    $Editor.InsertText(($msg  + "`r`n"))
}