TechTalkz.com Logo Ask the Expert

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Microsoft > Microsoft Windows Powershell

does .dot-sourcing a set of functions compile these into MSIL?

Microsoft Windows Powershell


Reply
 
LinkBack Thread Tools Display Modes
Old 24-10-2007, 02:50 AM   #1
Bob Landau
Guest
 
Posts: n/a
does .dot-sourcing a set of functions compile these into MSIL?

I understand that the functions are loaded into memory but I'm not sure
whether they are loaded as PS script: what appears when you type

dir function:<Func Name> | fl -property Definition


or whether the actual function that you invoke has been processed to IL

just curious

bob
  Reply With Quote
Old 24-10-2007, 02:50 AM   #2
Brandon Shell [MVP]
Guest
 
Posts: n/a
Re: does .dot-sourcing a set of functions compile these into MSIL?

It will be added the function list as if you typed it directly into the shell.


Brandon Shell
---------------
Blog: http://www.bsonposh.com/
PSH Scripts Project: www.codeplex.com/psobject

BL> I understand that the functions are loaded into memory but I'm not
BL> sure whether they are loaded as PS script: what appears when you
BL> type
BL>
BL> dir function:<Func Name> | fl -property Definition
BL>
BL> or whether the actual function that you invoke has been processed to
BL> IL
BL>
BL> just curious
BL>
BL> bob
BL>


  Reply With Quote
Old 24-10-2007, 02:51 AM   #3
Keith Hill [MVP]
Guest
 
Posts: n/a
Re: does .dot-sourcing a set of functions compile these into MSIL?

"Bob Landau" <BobLandau@discussions.microsoft.com> wrote in message
news:46877E56-F507-4C4E-8499-5EEAD30D3E0D@microsoft.com...

> or whether the actual function that you invoke has been processed to IL


No, they are just pre-parsed. This pre-parsing is handy because you can
then check your script for parse errors like so:

& { . .\funcs.ps1 }

--
Keith


  Reply With Quote
Old 24-10-2007, 02:51 AM   #4
Bob Landau
Guest
 
Posts: n/a
Re: does .dot-sourcing a set of functions compile these into MSIL

Thats want I thought (not what I had hoped) . I guess this is one an
incentive for writting a cmdlet rather than a function if the script is large


"Brandon Shell [MVP]" wrote:

> It will be added the function list as if you typed it directly into the shell.
>
>
> Brandon Shell
> ---------------
> Blog: http://www.bsonposh.com/
> PSH Scripts Project: www.codeplex.com/psobject
>
> BL> I understand that the functions are loaded into memory but I'm not
> BL> sure whether they are loaded as PS script: what appears when you
> BL> type
> BL>
> BL> dir function:<Func Name> | fl -property Definition
> BL>
> BL> or whether the actual function that you invoke has been processed to
> BL> IL
> BL>
> BL> just curious
> BL>
> BL> bob
> BL>
>
>
>

  Reply With Quote
Old 24-10-2007, 02:51 AM   #5
Oisin Grehan
Guest
 
Posts: n/a
Re: does .dot-sourcing a set of functions compile these into MSIL?

On Oct 9, 2:00 pm, Bob Landau <BobLan...@discussions.microsoft.com>
wrote:
> I understand that the functions are loaded into memory but I'm not sure
> whether they are loaded as PS script: what appears when you type
>
> dir function:<Func Name> | fl -property Definition
>
> or whether the actual function that you invoke has been processed to IL
>
> just curious
>
> bob


Powershell script, for the most part, is interpreted.

- Oisin / x0n.

  Reply With Quote
Reply

Thread Tools
Display Modes



< Home - Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT +5.5. The time now is 03:54 PM.


vBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2010, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional