Skip to content

Commit 5079ffb

Browse files
dfinkedaviwil
authored andcommitted
Implemented Out-Currentfile. Sends data from the pipeline to the current open file
1 parent 02e73a8 commit 5079ffb

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
function Out-CurrentFile {
2+
param(
3+
[Parameter(ValueFromPipeline)]
4+
$data
5+
)
6+
7+
Begin { $d = @() }
8+
Process { $d += $data }
9+
End {
10+
$target = "@`"`r`n{0}`r`n`"@" -f ($d|out-string).Trim()
11+
$pseditor.GetEditorContext().currentfile.inserttext($target)
12+
}
13+
}

0 commit comments

Comments
 (0)