# Introducing Simplex

§ July 31, 2014 10:05 by beefarino |

During my P2F talk at the PowerShell Summit NA 2014, I announced a project that would make creating a PowerShell Provider “stupid simple.”  I happily present you the first iteration of this stupid simplicity in the form of the Simplex open source project.

The goal of Simplex is to remove any barrier between the operator and the items they would like to access as a PowerShell drive.  Instead of focusing on C# types, interfaces, and cmdlet support, Simplex keeps you in script, using a simple domain-specific language (DSL) based on PowerShell to define a drive hierarchy.  Here is an example of the DSL:

root { # the root folder of the drive
folder System { # a folder named System
script Processes -id Id { # a folder named Processes
get-process                   # that contains Process objects
}
script Errors -id Index { # a folder named Errors containing event log entries
get-eventLog -log application -entrytype error -newest 25
}
}
}

To mount this Simplex script as a PowerShell drive, you just need to use the Simplex module, like so:

import-module simplex;
new-psdrive -name s -psprovider simplex -root "c:\path\to\simplexscript.ps1"

Once the script it mounted, you can navigate the folders and script containers as if they were a filesystem:

PS C:\Windows\SysWOW64\WindowsPowerShell\v1.0> cd s:

PS s:\> dir

Container: Simplex\Simplex::C:\share\simplex.ps1

Type       Name
---------- ----       ----
d+~<       Folder     System

PS s:\> cd system

PS s:\system> dir

Container: Simplex\Simplex::C:\share\simplex.ps1\system

Type       Name
---------- ----       ----
d+~<       Script     Processes
d+~<       Script     Errors

PS s:\system> cd errors

PS s:\system\errors> dir

Index Time          EntryType   Source                 InstanceID Message
----- ----          ---------   ------                 ---------- -------
63846 Jul 31 09:05  Error       Application Error            1000 ...


# Simplex DSL

The Simplex DSL has three elements: root, folders, and scripts.  Each element defines a container location on the drive.  The root element defines the root of the drive and contains any number of script and folder elements.

root {
# any number of script and/or folder elements
}

Folders can also contain other folders and script elements, and folders must have a name.

folder <foldername> {
# any number of script and/or folder elements
}

Scripts are containers that use bits of PowerShell to supply the items they contain.  Scripts elements also must have a name, and they can optionally specify an –idField parameter to identify a property to be used as the item’s child name.

script <foldername> [-idField <propertyname>] {
# PowerShell script to return objects from this folder
}

The DSL is “just PowerShell,” so you can actually do any PowerShell things you want to do.  In this example, the DSL generates folders on demand based on the available performance counter sets:

root {
get-counter -list * | foreach {
$folderName =$_.CounterSetName;

script $folderName { #... } } } When you mount and explore the drive, you’ll find a set of folders generated from the script: PS g:\> dir Container: Simplex\Simplex::C:\share\gen.ps1 Type Name ---------- ---- ---- d+~< Script RAS d+~< Script WSMan Quota Statistics d+~< Script Network QoS Policy d+~< Script SMB Client Shares d+~< Script SynchronizationNuma d+~< Script Synchronization d+~< Script Event Tracing for Win... d+~< Script Thermal Zone Information d+~< Script Processor Information d+~< Script Event Tracing for Win... d+~< Script FileSystem Disk Activity # ...  So please check out the project, submit any issues/features you find/want. And as always, enjoy! # Do It for the Children § April 10, 2014 12:01 by beefarino | So last year a bunch of us PowerShell smarty-pants donated a crap-ton of our own time and energy into putting together the PowerShell Deep Dive book. The book is full of amazing content, and you should buy a copy for that reason alone. I mean, just the chapter on automating software builds is worth the entire price of the book and I’m sure the author is also ruggedly handsome. Look, in all seriousness, the proceeds from this book go to Save the Children, an organization dedicated to helping children around the world have the basic necessities for healthy and productive lives. So, please consider purchasing a copy of this book, for any of the following reasons: • to read it • to gift it to someone else • you need a giveaway for a user group or event • you have or are considering a secret crush on one of the book authors or editors • you have OCD and your bookshelf is unevenly stacked on one side • your desk tends to defy gravity and you need to weigh it down • you need to appear smarter or more attractive than you actually are • you have about$35 of filthy germ-ridden cash of which you really need to rid yourself
• you use PowerShell, you suck at it, and you’re not ok with that

Once you purchase a copy, you can continue to help this book raise money for Save the Children in several ways.  First, tell others to buy their own copy.  Second, whenever you’re in your favorite brick & mortar bookstore, just ask them if they have it.  Most larger book stores keep track of these inquiries, so the more you ask, the more copies they’ll stock, and the more money will go to charity.

Unless of course, you want the children of the world to starve, which … you know ……

… by not buying a copy ……..

… it seems like you do…………….

# A Great Start to April

§ April 8, 2014 16:30 by beefarino |

I’m pleased to report that I’ve been renewed as a PowerShell MVP for another year!

I spent the bulk of 2013 focused on making open-source software – much of it orbiting PowerShell and integration with various technologies like transactional file systems and scriptcs.  I was nervous about losing the award by focusing less on teaching and speaking, but thankfully the team saw value in what I’ve been up to.

Looking ahead, I don’t plan on changing my focus much.  I have plenty of projects in the pipeline (pun intended) that I want to get to a release point in the coming months, and yes most of them still orbit PowerShell.  No reveals here, but perhaps a few hints – do you work with large SSIS package deployments?  Do you like the idea of SeeShell but not so much the cost?  Oh, or maybe you find yourself wishing PowerShell could just learn things by looking at data?

Sound interesting?  Then perhaps you should keep a close eye on my little blog this year.

# Reflectrospective: Year Four of Independence

§ March 20, 2014 22:58 by beefarino |

March marks the passing of a personal milestone: four years of working for myself.  So this is the point where you make jokes about my boss being a jerk or the fact that no one else would hire me.  S’ok, I don’t mind.  It’s why I’m here.

This past year was crazy.  By design really.  I didn’t end up doing all the things I planned to do, but hey, “the best laid plans …” and so forth.  Besides, being able to pivot as I see fit is one of the first reasons I’m independent, and I am pretty happy with the way things have turned out.

Here are some of the highlights from the past year:

• I’ve pushed six new highly-targeted open source projects.  And there are more coming in the next year, spanning automation and discovery frameworks for business intelligence to some nifty shell-aware data visualization tools.
• I’ve released several major revisions to StudioShell, including support for Visual Studio 2013, a version specifically designed for the Nuget package manager console, along with an example of how to use it in your own Nuget packages.  So, you know, go on and use it.
• I’ve published two new Pluralsight courses (log4net and PowerShell Gotchas!) which, if I do say so myself, are very well done.  In addition I have another course in the works which should be out in the next month or two on publishing custom performance counters in your applications. And it too is very well done :)
• I’ve learned more about scaling application data layers and SQL server than I really ever cared to.  Still, it’s been an interesting and view-shifting journey, which I always enjoy.
• I’ve expanded my speaking horizons with soft-skills, architecture, devops, and of course software development talks.  Moreover, I hope the coming year will find me speaking to new, larger, and wider audiences as well – for instance I’ll be presenting three sessions at the upcoming PowerShell Summit in Redmond next month.
• I’ve started fiction writing again.  I don’t do it very well or very often, but I’m learning to enjoy doing it poorly and infrequently.
• I opened up about a dark part of my life; not for commentary, not for attention, but out of gratitude to those who support me and concern for those looking for their own support.
• I’ve learned a new instrument – the ukulele.  I love it – it is impossible to be angry or stressed while playing a uke.  And it seems to please the right people and annoy the crap out of the others.  So you know, win-win.
• I’ve crocheted four baby blankets, one massive ugly afghan, and countless hats and scarves.  Currently working on baby blanket number five; seriously, y’all need to stop making them babies.

Of course it’s not all rainbows and unicorns.  I know there are things I need shore up and put real focus on.  Businessish things.  And I’m working on it.  Seriously, shut up about it.

At this point I would make some statements about what I plan to do in the coming year.  Outside of what I’ve already mentioned, I’m not doing that this time.  Instead, let’s just say I’m heading where I need to go at the pace I need to travel.

Which is, after all the point of all this responsibility and effort right?