PowerShell Summit Europe – Tuesday morning

After a very successful DSC hackathon on Monday evening we reconvened on Tuesday morning with Steve Murawski delivering his second session on DSC.

A brief discussion on devops lead into looking at DSC configurations:

  • Configuration names can’t be hyphenated
  • Circular dependencies are detected
  • Partial named configurations allow multiple configurations working against same machine

The morning’s second session was me talking about creating cmdlets from the CIM StdRegProv class using a CDXML approach.  The talk started with using a single method and demonstrated how to add validation, simplify parameter input by the use of enumerations and how CDXML modules are used within PowerShell.

Dan Harman closed the morning session by talking about classes written in PowerShell – this functionality was introduced in the September preview of WMF 5

You can already define a class and load it with Add-Type but you have to write the class in C# or another .NET language. Now you can write the class in PowerShell

Classes can have overloaded constructors and methods.  All class members are public by default.

Enums are possible. Scoping is lexical not dynamic as in PowerShell

This entry was posted in Powershell, Summit. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s