Windows Vista Forums
Vista Forums Home Join Vista Forums Webcasts Windows 7 Forum Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

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

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 10-09-2007   #1 (permalink)
Bob Landau
Guest


 

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

My System SpecsSystem Spec
Old 10-09-2007   #2 (permalink)
Brandon Shell [MVP]
Guest


 

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>


My System SpecsSystem Spec
Old 10-09-2007   #3 (permalink)
Keith Hill [MVP]
Guest


 

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

"Bob Landau" <BobLandau@xxxxxx> wrote in message
news:46877E56-F507-4C4E-8499-5EEAD30D3E0D@xxxxxx
Quote:

> 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


My System SpecsSystem Spec
Old 10-09-2007   #4 (permalink)
Bob Landau
Guest


 

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:
Quote:

> 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>
>
>
>
My System SpecsSystem Spec
Old 10-09-2007   #5 (permalink)
Oisin Grehan
Guest


 

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

On Oct 9, 2:00 pm, Bob Landau <BobLan...@xxxxxx>
wrote:
Quote:

> 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.

My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dot sourcing multiple code files henry Macoy PowerShell 3 10-01-2007 01:18 PM
sourcing a file in a script JasonM PowerShell 5 08-31-2007 03:22 PM
WMP 11 Library won't compile encee Vista music pictures video 5 11-15-2006 06:33 AM
Pre-compile script? Nick Howell PowerShell 0 06-15-2006 07:57 AM
Why don't any of the 3D samples compile? JD Avalon 2 03-03-2006 10:26 PM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51