unable to use snapin

Oct 11, 2007 at 6:58 AM
Edited Oct 11, 2007 at 7:03 AM
Hi There,

I was thrilled to see that we could use .NET events in powershell. I've been working on a Exchange management console a few weeks ago, which I saw burn down in flames once I couldn't get treeview and propertygrid events working. I was ready to switch over to C# untill I found pseventing.

Anyways. I registerered the dll, but the snapin is not found in the registered list.... Any ideas?

Thanks,

Mark

---------------------------------------------------------------------
Beginning the Install phase of the installation.
See the contents of the log file for the C:\Temp\Gui\Nivot.PowerShell.Eventing.dll assembly's progress.
The file is located at C:\Temp\Gui\Nivot.PowerShell.Eventing.InstallLog.
Installing assembly 'C:\Temp\Gui\Nivot.PowerShell.Eventing.dll'.
Affected parameters are:
logtoconsole =
assemblypath = C:\Temp\Gui\Nivot.PowerShell.Eventing.dll
logfile = C:\Temp\Gui\Nivot.PowerShell.Eventing.InstallLog

The Install phase completed successfully, and the Commit phase is beginning.
See the contents of the log file for the C:\Temp\Gui\Nivot.PowerShell.Eventing.dll assembly's progress.
The file is located at C:\Temp\Gui\Nivot.PowerShell.Eventing.InstallLog.
Committing assembly 'C:\Temp\Gui\Nivot.PowerShell.Eventing.dll'.
Affected parameters are:
logtoconsole =
assemblypath = C:\Temp\Gui\Nivot.PowerShell.Eventing.dll
logfile = C:\Temp\Gui\Nivot.PowerShell.Eventing.InstallLog

The Commit phase completed successfully.

The transacted install has completed.
PS C:\Temp\Gui> Get-PSSnapin -Registered


Name : Microsoft.Exchange.Management.PowerShell.Admin
PSVersion : 1.0
Description : Admin Tasks for the Exchange Server


Oct 11, 2007 at 7:10 AM
Ok.... Found it... It is working/supported on a x64 version of Powershell it seems.
Any plans to get this working?

Cheers,

Mark
Coordinator
Oct 11, 2007 at 11:34 PM
Hi Mark,

in order to see the snapin on a 64bit posh, you need to use the 64bit installutil.exe to register the snapin dll. From http://msdn2.microsoft.com/en-us/library/ms714644.aspx

The version of the InstallUtil program that you must use varies depending on whether you are installing on a 32-bit or 64-bit platform. 
 
To install 32-bit registry information, use: %systemroot%\Microsoft.NET\Framework\v2.0.50727\installutil.exe.
 
To install 64-bit registry information, use: %systemroot%\Microsoft.NET\Framework64\v2.0.50727\installutil.exe.

Hope this helps,

- Oisin

Coordinator
Oct 11, 2007 at 11:42 PM
Also, not wanting to burst your bubble, but you'll have a hard time hosting winforms objects in powershell without some considerable thought into avoiding STA issues. :-(
Oct 12, 2007 at 6:19 AM
Hi Oisin....

Ahhh how could I forget. I had the same issue a while back.
I testdrived pseventing in the 32bit console and indeed did not find an easy way to use it in conjunction with Winforms. Luckely I was able to get the required functionality with the events exposed by powershell, namely the afterselect and click.

Regards,

Mark