Using PowerShell to Program against M

by Doug Finke on March 8, 2009

in M,Oslo,PSMDTAG:FAQ PowerShell and Oslo,PowerShell

Jon Flanders blogged Programming against M in which he uses the M Compiler to retrieve M artifacts. He processed all the Models that are part of the Oslo SDK retrieving the extent names.

Following his example I built a PowerShell Function Get-ExtentTypeNames. Here is one result the function can be used to generate .

Get-ExtentTypeNames | Group -NoElement ModuleName | Sort Count -Descending | Format-Table –AutoSize

image 

LINQ and PowerShell

Jon used LINQ to grab the first CollectionType out of the ParameterizedExpression. I thought the PowerShell version was interesting.

LINQ

image
PowerShell image

What is M?

The “M” language is a declarative language for working with data and building domain models in Oslo. “Oslo" is the code name for the Microsoft’s next generation application development platform.

Download PowerShell Code

You need to have the latest Oslo SDK installed.

{ 1 comment… read it below or add one }

Steven Murawski 03.11.09 at 1:22 pm

I did not know about the “as” operator in PowerShell… Very cool!

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>