ISE-CopyOutPutToEditor (modification of post by view diff)
View followups from Bernd Kriszio | embed code: <script type="text/javascript" src="http://PoshCode.org/embed/779"></script>download | new post
Some of the new ISE custom menue functions only work in the editor pane and not in the output. If you have something in the output that you want to use, just copy it to a fresh editor pane. You can even save it, if you want. Nobody said, that only valid PowerShell scripts can be edited by ISE
- function ISE-CopyOutPutToEditor () {
- $count = $psise.CurrentOpenedRunspace.OpenedFiles.count
- $psIse.CurrentOpenedRunspace.OpenedFiles.Add()
- $Newfile = $psIse.CurrentOpenedRunspace.OpenedFiles[$count]
- $Newfile.Editor.Text = $psIse.CurrentOpenedRunspace.output.Text
- $Newfile.Editor.Focus()
- # $psise.CurrentOpenedFile.editor.Text = $psIse.CurrentOpenedRunspace.output.Text
- }
- $null = $psIse.CustomMenu.Submenus.Add("Copy Output to Editor", {ISE-CopyOutPutToEditor}, 'Ctrl+O')
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.
PowerShell Code Repository