views:

21

answers:

1

Hi all, is possible to load the $psise object in the console? I want to open several files in ISE but doing

>ise filename
>ise filename2

just open the first one. Inside ISE i don't have that problem because i use the $psise object to open the file

function qwe($file){
if(-not (Test-Path $file)){
    New-Item -Name $file -ItemType file
}
$filepath = Resolve-Path $file;
$psISE.CurrentPowerShellTab.Files.Add($filepath)
}
A: 

$psISE is property available only in PowerShell_Ise.exe environment, so shortly said: no.
However, opening two files works for me - it opens new tab with the file.

stej
maybe is a bug, i tested several times and I found a pattern. If i apply the code that i say without having the focus in the script pane of ISE a new tab is open. If i have the cursor in the script pane, any subsequent call to ise filenameX is ignored
voodoomsr