我的个人资料中有以下功能定义:
// alias for inner query
MyEntity inner = null;
// this alias is for outer query, and will be used in
// inner query as a condition in the HAVING clause
MyEntity outer = null;
var minIdSubquery = QueryOver.Of<MyEntity>(() => inner)
.SelectList(l => l
.SelectGroup(() => inner.Ref) // here we GROUP BY
.SelectMin(() => inner.Id)
)
// HAVING to get just Min(id) match
.Where(Restrictions.EqProperty(
Projections.Min<MyEntity>(i => i.Id),
Projections.Property(() => outer.Id)
));
// outer query
var query = session.QueryOver<MyEntity>(() => outer)
.WithSubquery
// we can now use EXISTS, because we applied match in subquery
.WhereExists(minIdSubquery);
但是当我执行函数function design {
Set-Location $env:CC72\Designer
.\RunDesigner.bat
}
时,PowerShell会执行两次批处理RunDesigner.bat并启动它的两个实例:
design
为什么?
更新1
批次的内容如下:
PS C:\Users\s3201> design
Starting Designer...
Starting Designer...
PS C:\customer\Designer>
更新2
如果我从提到批处理的目录启动Vim,那么它们同时启动 - Vim和批处理文件
因此,问题开始时消息的原因很明显 - PowerShell尝试首先启动该批处理,找不到它,写入消息并启动Vim。但为什么它首先尝试启动该批次呢?
显然,根本原因在于某些PowerShell定义。哪个? (我检查了别名)。