Windows Vista Forums
Vista Forums Home Join Vista Forums Donate 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

Integrating Powershell and C# 2.0

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 10-15-2006   #1 (permalink)
Mugunth
Guest


 

Integrating Powershell and C# 2.0

Hi,
I wrote a simple mock application that'll make some automated calls to
com objects.


using System.Management.Automation;

namespace PWSApp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
RunspaceInvoke rsi = new RunspaceInvoke();
rsi.Invoke("$WMP = new-object -ComObject WMPlayer.OCX");
rsi.Invoke("$WMP.openPlayer(\"SongName.mp3\");");

}
}
}

My Question here is,

What all should I ship with this executable (apart from .NET Framework
2.0) so that I can ensure that this application works on all machines.
Is there any specific dll that should be distributed so that PowerShell
specific features will work? Or is this bundled with .NET Framework
2.0?

Regards,
Mugunth


My System SpecsSystem Spec
Old 10-16-2006   #2 (permalink)
dreeschkind
Guest


 

RE: Integrating Powershell and C# 2.0

"Mugunth" wrote:

> What all should I ship with this executable (apart from .NET Framework
> 2.0) so that I can ensure that this application works on all machines.
> Is there any specific dll that should be distributed so that PowerShell
> specific features will work? Or is this bundled with .NET Framework
> 2.0?


AFAIK PoSh will be released as an optional Windows Update later this year.
Once all your machines have been updated and .NET Framework 2.0 is installed,
everything should be fine.

Copying only the core PoSh assemblies (System.Management.Automation etc.)
might work (I did not test it), but I doubt that this is recommended or
supported.

--
greetings
dreeschkind
My System SpecsSystem Spec
Old 10-16-2006   #3 (permalink)
Andrew Webb
Guest


 

RE: Integrating Powershell and C# 2.0

> What all should I ship with this executable (apart from .NET Framework
> 2.0) so that I can ensure that this application works on all machines.
> Is there any specific dll that should be distributed so that PowerShell
> specific features will work? Or is this bundled with .NET Framework
> 2.0?


Let the PowerShell WU (windows update) install the necessary DLLs to the
GAC. Consider using the System.Activator class to late-bind to the
PowerShell types, and provide a nice error message to the user if PowerShell
isn't installed.

Andrew
My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
yahoo not integrating in windows mail help please!!!!! Ryan Vista mail 2 08-18-2008 05:53 PM
integrating VBS into macro ayeFayze VB Script 0 06-04-2008 03:34 PM
Integrating SP1 into Vista DVD? Brian W Vista General 3 12-12-2007 03:53 PM
LABS: Writing PowerShell cmdlets and integrating with MMC Marco Shaw PowerShell 0 06-21-2007 06:51 AM
Integrating English Speech recognition? Pim Vista General 3 03-07-2007 06:31 PM


Update your Vista Drivers Update Your Drivers Now!!

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