Linking against RC2

Linking against RC2

Rate This
  • Comments 9

The RC2 SDK is not yet available.  Until it is, here is a quick and dirty way for you to find/extract the DLLs to link your code against.  Do this from a RC2 shell and you'll a copy of the DLLS in C:\SDK:

 

PS>[appdomain]::currentdomain.getassemblies() |

where {($_.fullname -match "system.management") -OR ($_.fullname –match "Microsoft")} |

copy-item -path {$_.location} -destination c:\sdk\ -verbose

 

Enjoy!

Jeffrey Snover [MSFT]
Windows PowerShell/MMC Architect
Visit the Windows PowerShell Team blog at:    http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at:  http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx

 

NOTE: Added January 5th, 2009 - If you add a hard coded reference to C:\Sdk in your visual studio projects,  then two side effects will happen.  First, your project will not work if the sdk is not in C:\SDK.  Second, you will only have as up-to-date assemblies as are in C:\SDK.  I personally edit the .csproj files with notepad, find an existing reference (e.g. System.Xml), copy and paste this item, and change the reference to System.Management.Automation.  This builds against the most up-to-date System.Management.Automation reference on the system.

 

Hope this Helps,

James Brundage [MSFT]  

Leave a Comment
  • Please add 2 and 5 and type the answer here:
  • Post
  • PS>[appdomain]::currentdomain.getassemblies() | where {($_.fullname -match "system.management") -OR ($_.fullname –match "Microsoft.PowerShell")} | copy-item -path {$_.location} -destination c:\sdk\ -verbose ;)
  • >quick and dirty way sure is! you rock Jeff. i've updated the help-navigation tool "ShinyPower" to work with RC2, and put it at code plex: http://www.codeplex.com/Wiki/View.aspx?ProjectName=ShinyPower i'll be releasing the source code as soon as i get my head around the TFS client. Note that now on CodePlex, the PowerShell tag has finally made it onto the front page (popular tags). best of luck. lb
  • The C:\SDK folder has to exist before you run the one-liner, otherwise you get "Copy-Item : The filename, directory name, or volume label syntax is incorrect".
  • Is there an RC2 build available for Vista? The XPSP2 build won't install on the RC1 build of Vista (RC2 complains that the OS is running a lower SP than allowable.)
  • Boo Yaaah.  Thank!!!

  • This is the most convoluted bullshit! Why was the DLL not packaged with RTM?

  • > Why was the DLL not packaged with RTM?

    Sadly, this is against the rules for shipping Windows components.  Its easy to rage against the machine but the reality is that Windows is one of the largest/most complex engineering efforts in the history of the world (that might be a tad too grandiose but not by much).  You've got many thousands of engineers all trying to do different things simultaneously.  The only way to keep the wheels on the bus is to have lots of rules and to apply them aggressively.  The orgin of the rules is manifold from engineering best practices, to avoidance of arcane side effects, wisedom dervied from deep scars, governmental guidance (:-)), etc.  

    I have to admit, when I come across rules like this, I sometimes have exactly the same reaction that you did but when I've drilled in to the details and found out what why the rule exists, it invariable has been reasonable.  At the end of the day, you've got really smart people all trying to move the ball forward as quickly as possible (I include our governmental friends in that statement as well).

    So let me apologize for the inconvenience (I still mutter a little grumble I have to do this myself) and ask you to grin and bear it.

    Jeffrey Snover [MSFT]

    Windows PowerShell/MMC Architect

    Visit the Windows PowerShell Team blog at:    http://blogs.msdn.com/PowerShell

    Visit the Windows PowerShell ScriptCenter at:  http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx

  • That said, the PowerShell SDK is now available, and this step is not absolutely required: http://blogs.msdn.com/powershell/archive/2006/12/11/windows-powershell-sdk.aspx

    Lee

  • I installed the SDK as indicated in the previous post.  But I still don't see it in the Add Reference window.

Page 1 of 1 (9 items)