Yggdrasil wrote:
How about this:
Assembly.GetEntryAssembly().GetName().Name == "PowerShell";
Is that what you're looking for?
Unfortunately that won't work. GetEntryAssembly returns null, presumably because the assembly is being loaded from unmanaged code.
It looks like I'm going to have to use an interop hack and call GetModuleFileName, but I'd prefer to not have to do that.