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

Accessing System 32 and COM API's for Vista thru Powershell

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 12-15-2007   #1 (permalink)
Spooky
Guest


 

Accessing System 32 and COM API's for Vista thru Powershell

Hi,

I'm new to Powershell and so far its been geat..as long as i didn't stray
too far from .Net and WMI stuff.

Now i'm to the point where i'm looking at possibly converting some of the
specific use things I've done in C++ for Vista to use them in Powershell. I
did these things based upon the new API's present in Vista like here:
http://msdn2.microsoft.com/en-us/library/bb776780.aspx

Yeah, I understand that API's aren't intended for direct admin interaction
whereas cmdlets are, but if its possible to access some of this stuff i'd
like to be able to do it. So I guess my question would be, how can i access
these Vista API's and use them in Powershell?

I've spent the last week browsing thru the various sites and blogs looking
for things that are helpful, found a lot of stuff that was "almost but not
really" things, and I have the concept of objects in Powershell down to a
pretty reliable and comfortable level for me at least but I always stall out
when trying to get to these API's, I know where i'm at, where i want to go,
but just a "can't get there from here" thing is stalling my progess.

Like for example, how would i access the Vista API IFileDialog interface and
its members..or...any of the new functions like PathCreateFromUrlAlloc,

Any examples or help would be great if anyone has any ideas on the subject.

Thanks


My System SpecsSystem Spec
Old 12-15-2007   #2 (permalink)
Shay Levi
Guest


 

Re: Accessing System 32 and COM API's for Vista thru Powershell


If you want to run in-line C# code in PowerShell, search this group for
"Re: Invisible Windows" (by Bruce Payette) its from the 8/15/2007.

Another example, though from the early days of PowerShell (Monad),
shows how to embed C# code to invoke a Win32API. Read the comments also.
http://blogs.msdn.com/powershell/arc...25/583236.aspx


-----
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com
Hebrew weblog: http://blogs.microsoft.co.il/blogs/scriptfanatic


Quote:

> Hi,
>
> I'm new to Powershell and so far its been geat..as long as i didn't
> stray too far from .Net and WMI stuff.
>
> Now i'm to the point where i'm looking at possibly converting some of
> the specific use things I've done in C++ for Vista to use them in
> Powershell. I did these things based upon the new API's present in
> Vista like here:
> http://msdn2.microsoft.com/en-us/library/bb776780.aspx
>
> Yeah, I understand that API's aren't intended for direct admin
> interaction whereas cmdlets are, but if its possible to access some of
> this stuff i'd like to be able to do it. So I guess my question would
> be, how can i access these Vista API's and use them in Powershell?
>
> I've spent the last week browsing thru the various sites and blogs
> looking for things that are helpful, found a lot of stuff that was
> "almost but not really" things, and I have the concept of objects in
> Powershell down to a pretty reliable and comfortable level for me at
> least but I always stall out when trying to get to these API's, I know
> where i'm at, where i want to go, but just a "can't get there from
> here" thing is stalling my progess.
>
> Like for example, how would i access the Vista API IFileDialog
> interface and its members..or...any of the new functions like
> PathCreateFromUrlAlloc,
>
> Any examples or help would be great if anyone has any ideas on the
> subject.
>
> Thanks
>

My System SpecsSystem Spec
Old 12-15-2007   #3 (permalink)
Spooky
Guest


 

Re: Accessing System 32 and COM API's for Vista thru Powershell

Thanks for the respons Shay,

Couldn't find the group post you referenced but i did look at the link you
provided. Its very interesting, i'm going to give it a go.

Thanks

"Shay Levi" wrote:
Quote:

>
> If you want to run in-line C# code in PowerShell, search this group for
> "Re: Invisible Windows" (by Bruce Payette) its from the 8/15/2007.
>
> Another example, though from the early days of PowerShell (Monad),
> shows how to embed C# code to invoke a Win32API. Read the comments also.
> http://blogs.msdn.com/powershell/arc...25/583236.aspx
>
>
> -----
> Shay Levi
> $cript Fanatic
> http://scriptolog.blogspot.com
> Hebrew weblog: http://blogs.microsoft.co.il/blogs/scriptfanatic
>
>
>
Quote:

> > Hi,
> >
> > I'm new to Powershell and so far its been geat..as long as i didn't
> > stray too far from .Net and WMI stuff.
> >
> > Now i'm to the point where i'm looking at possibly converting some of
> > the specific use things I've done in C++ for Vista to use them in
> > Powershell. I did these things based upon the new API's present in
> > Vista like here:
> > http://msdn2.microsoft.com/en-us/library/bb776780.aspx
> >
> > Yeah, I understand that API's aren't intended for direct admin
> > interaction whereas cmdlets are, but if its possible to access some of
> > this stuff i'd like to be able to do it. So I guess my question would
> > be, how can i access these Vista API's and use them in Powershell?
> >
> > I've spent the last week browsing thru the various sites and blogs
> > looking for things that are helpful, found a lot of stuff that was
> > "almost but not really" things, and I have the concept of objects in
> > Powershell down to a pretty reliable and comfortable level for me at
> > least but I always stall out when trying to get to these API's, I know
> > where i'm at, where i want to go, but just a "can't get there from
> > here" thing is stalling my progess.
> >
> > Like for example, how would i access the Vista API IFileDialog
> > interface and its members..or...any of the new functions like
> > PathCreateFromUrlAlloc,
> >
> > Any examples or help would be great if anyone has any ideas on the
> > subject.
> >
> > Thanks
> >
>
>
>
My System SpecsSystem Spec
Old 12-17-2007   #4 (permalink)
Marco Shaw [MVP]
Guest


 

Re: Accessing System 32 and COM API's for Vista thru Powershell

Spooky wrote:
Quote:

> Thanks for the respons Shay,
>
> Couldn't find the group post you referenced but i did look at the link you
> provided. Its very interesting, i'm going to give it a go.
>
> Thanks
http://groups.google.com/group/micro...89e05f43f6a0db


--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing Exchange 5.5 hidden recipients with PowerShell ADSI Dan Roberts @ Kent State PowerShell 1 07-22-2008 02:35 PM
Win32 API's in Powershell - FindWindow and SendMessage Bill V. PowerShell 12 12-10-2007 03:14 PM
system lockup when accessing large files from IDE nabeel46 Vista General 3 09-30-2007 06:08 PM
Accessing the Environemnt from PowerShell bill PowerShell 1 01-11-2007 01:02 PM
accessing the extended type system from C# klumsy@xtra.co.nz PowerShell 4 10-10-2006 10:41 AM


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