<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:evnet="http://www.mscommunities.com/rssmodule/"><channel><title>Comment Feed for Question about PowerShell and .NET assemblies (TechOff on Channel 9)</title><atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/forums/techoff/252260-question-about-powershell-and-net-assemblies/rss/default.aspx" /><image><url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url><title>Comment Feed for Question about PowerShell and .NET assemblies (TechOff on Channel 9)</title><link>http://channel9.msdn.com/forums/TechOff/252260-Question-about-PowerShell-and-NET-assemblies/</link></image><description>Question about PowerShell and .NET assemblies</description><link>http://channel9.msdn.com/forums/TechOff/252260-Question-about-PowerShell-and-NET-assemblies/</link><language>en-us</language><pubDate>Sun, 11 Feb 2007 17:18:11 GMT</pubDate><lastBuildDate>Sun, 11 Feb 2007 17:18:11 GMT</lastBuildDate><generator>EvNet (EvNet, Version=1.0.3243.35083, Culture=neutral, PublicKeyToken=null)</generator><item><title>Re: Question about PowerShell and .NET assemblies</title><description>The same basic difference there. My issue isn't so much with interop as having to use "magic strings" like the module filename to determine what loaded the assembly. It looks like the solution is to get the module name and version info and do a bunch of sanity checks.&lt;br /&gt;&lt;br /&gt;I guess what I'm really driving at is I'd like some way to reliably ask "Am I being&amp;nbsp;loaded in a script, not a compiled executable?" so that certain decisions could be made about behavior, default property values and licensing.</description><comments></comments><link>http://channel9.msdn.com/forums/TechOff/252260-Question-about-PowerShell-and-NET-assemblies/?CommentID=286671</link><pubDate>Sun, 11 Feb 2007 17:18:11 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/forums/TechOff/252260-Question-about-PowerShell-and-NET-assemblies/?CommentID=286671</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/286671/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>The same basic difference there. My issue isn't so much with interop as having to use "magic strings" like the module filename to determine what loaded the assembly. It looks like the solution is to get the module name and version info and do a bunch of sanity checks.I guess what I'm really driving&amp;#8230;</evnet:previewtext><dc:creator>mstefan</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/286671/Trackback.aspx</trackback:ping></item><item><title>Re: Question about PowerShell and .NET assemblies</title><description>&lt;blockquote&gt;
				&lt;div&gt;mstefan wrote:&lt;/div&gt;
				&lt;div&gt;﻿
&lt;blockquote&gt;
&lt;table&gt;

&lt;tr&gt;
&lt;td&gt;&lt;img src="http://channel9.msdn.com/Themes/AlmostGlass/images/icon-quote.gif /&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Yggdrasil wrote:&lt;/strong&gt;

&lt;i&gt;﻿How about&amp;nbsp;this: 
&lt;p&gt;Assembly.GetEntryAssembly().GetName().Name == "PowerShell";&lt;br /&gt;&lt;br /&gt;Is that what you're looking for?&lt;/p&gt;&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Unfortunately that won't work. GetEntryAssembly returns null, presumably because the assembly is being loaded from unmanaged code.&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;/div&gt;
		&lt;/blockquote&gt;
		&lt;br /&gt;
		&lt;br /&gt;
&lt;p&gt;Process.GetCurrentProcess().MainModule.FileName?&lt;/p&gt;</description><comments></comments><link>http://channel9.msdn.com/forums/TechOff/252260-Question-about-PowerShell-and-NET-assemblies/?CommentID=286656</link><pubDate>Sun, 11 Feb 2007 15:21:20 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/forums/TechOff/252260-Question-about-PowerShell-and-NET-assemblies/?CommentID=286656</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/286656/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>	mstefan wrote:
				﻿





Yggdrasil wrote:

﻿How about&amp;nbsp;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&amp;#8230;</evnet:previewtext><dc:creator>Yggdrasil</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/286656/Trackback.aspx</trackback:ping></item><item><title>Re: Question about PowerShell and .NET assemblies</title><description>&lt;blockquote&gt;
				&lt;div&gt;Yggdrasil wrote:&lt;/div&gt;
				&lt;div&gt;﻿How about&amp;nbsp;this: 
&lt;p&gt;Assembly.GetEntryAssembly().GetName().Name == "PowerShell";&lt;br /&gt;&lt;br /&gt;Is that what you're looking for?&lt;/p&gt;&lt;/div&gt;
		&lt;/blockquote&gt;
		&lt;br /&gt;
		&lt;br /&gt;Unfortunately that won't work. GetEntryAssembly returns null, presumably because the assembly is being loaded from unmanaged code.&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;</description><comments></comments><link>http://channel9.msdn.com/forums/TechOff/252260-Question-about-PowerShell-and-NET-assemblies/?CommentID=286651</link><pubDate>Sun, 11 Feb 2007 14:24:42 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/forums/TechOff/252260-Question-about-PowerShell-and-NET-assemblies/?CommentID=286651</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/286651/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>	Yggdrasil wrote:
				﻿How about&amp;nbsp;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&amp;#8230;</evnet:previewtext><dc:creator>mstefan</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/286651/Trackback.aspx</trackback:ping></item><item><title>Re: Question about PowerShell and .NET assemblies</title><description>How about&amp;nbsp;this: 
&lt;p&gt;Assembly.GetEntryAssembly().GetName().Name == "PowerShell";&lt;br /&gt;&lt;br /&gt;Is that what you're looking for?&lt;/p&gt;</description><comments></comments><link>http://channel9.msdn.com/forums/TechOff/252260-Question-about-PowerShell-and-NET-assemblies/?CommentID=286643</link><pubDate>Sun, 11 Feb 2007 13:10:49 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/forums/TechOff/252260-Question-about-PowerShell-and-NET-assemblies/?CommentID=286643</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/286643/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>How about&amp;nbsp;this: 
Assembly.GetEntryAssembly().GetName().Name == "PowerShell";Is that what you're looking for?</evnet:previewtext><dc:creator>Yggdrasil</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/286643/Trackback.aspx</trackback:ping></item><item><title>Re: Question about PowerShell and .NET assemblies</title><description>&lt;p&gt;[Too quick clicking the wrong button there...]&lt;/p&gt;</description><comments></comments><link>http://channel9.msdn.com/forums/TechOff/252260-Question-about-PowerShell-and-NET-assemblies/?CommentID=286639</link><pubDate>Sun, 11 Feb 2007 12:18:32 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/forums/TechOff/252260-Question-about-PowerShell-and-NET-assemblies/?CommentID=286639</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/286639/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>[Too quick clicking the wrong button there...]</evnet:previewtext><dc:creator>mstefan</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/286639/Trackback.aspx</trackback:ping></item></channel></rss>