控制台Powershell中的$ psise对象

时间:2010-08-05 14:24:14

标签: powershell powershell-ise

可以在控制台中加载$ psise对象吗? 我想在ISE中打开几个文件,但是要做

>ise filename
>ise filename2

打开第一个。在ISE里面我没有那个问题,因为我使用$ psise对象来打开文件

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

1 个答案:

答案 0 :(得分:1)

$psISE仅在PowerShell_Ise.exe环境中可用,所以很快就会说:没有
但是,打开两个文件对我有用 - 它会打开一个包含该文件的新选项卡。

相关问题