Classes in PowerShell have been a feature since long and creating objects of these classes isn’t new. From the classic way of creating objects of .NET classes (like the MailMessage in Example 1 below) or to defining a custom .NET class (in the Example 2 below), we have seen PowerShell extend .NET classes and types in numerous ways.
Example 1: Creating object of a .NET class
$message = New-Object System.Net.Mail.MailMessage
Example 2: Defining .NET class in PowerShell
public class BasicTest
public static int Add(int a, int b)
return (a + b);
public int Multiply(int a, int b)
return (a * b);
Add-Type -TypeDefinition $source
The New PowerShell Classes
Now with new version PowerShell, you can create classes in PowerShell instead of just using .NET classes. Object Orientation is now available in your scripting language so that you can shorten your scripts and make them more maintainable.
Two of my short videos (published on Channel9) will help you quickly rampup your PowerShell skills to create PowerShell classes, objects, methods, overloads, scope and a lot more.
Video 1: Getting Started with PowerShell Classes
Direct Link: https://channel9.msdn.com/Events/APAC-Influencer-Hero-2015/Singapore-Influencer-Showcase/01-Punit-Ganshani-PowerShell-Classes-for-Developers-Part-1
Video 2: Constructor, Methods, Overloading and Scope
Direct Link: https://channel9.msdn.com/Events/APAC-Influencer-Hero-2015/Singapore-Influencer-Showcase/01-Punit-Ganshani-PowerShell-Classes-for-Developers-Part-2
Hope this helps you in understanding PowerShell classes!
Have you tried Visual Studio Online (or Visual Studio Team Services, as it is now called) for build automation? VSTS (TFS 2015) has a new and much powerful build engine than TFS 2013 and you can now configure build automation for NodeJS, Java, Android, XCode and .NET.
The video recording below is a quick guide to configure Cross Platform Build Automation with VSTS or TFS 2015 (on-prem)
Direct Link: https://channel9.msdn.com/Events/APAC-Influencer-Hero-2015/Singapore-Influencer-Showcase/01-Punit-Ganshani-DevOps-Build-Automation-with-VSTS–TFS-2015
In the last month, I recorded 3 sessions, 15 minutes each, that illustrate Telemetry for Internet of Things – Pre and Post Azure IoT Suite for Channel 9.
These short videos can help the audience understand general concept of Internet of Things, Event Hubs, Azure IoT Suite and Hub. The examples discussed in the video are in .NET and NodeJS
Video #1: Understanding IoT and Event Pipeline
Direct Link: https://channel9.msdn.com/Events/APAC-Influencer-Hero-2015/Singapore-Influencer-Showcase/01-Punit-Ganshani-Internet-of-Things-1-Understanding-IoT-Event-Processing-Pipeline-and-Event-Hub
Video #2: Azure Event Hubs using Azure SDK and NodeJS
Direct Link: https://channel9.msdn.com/Events/APAC-Influencer-Hero-2015/Singapore-Influencer-Showcase/01-Punit-Ganshani-Internet-of-Things-2-Azure-Event-Hubs-using-SDK-and-NodeJS
Video #3: Azure IoT Suite – Device Provisioning, Producer, Consumer and Registry
Direct Link: https://channel9.msdn.com/Events/APAC-Influencer-Hero-2015/Singapore-Influencer-Showcase/01-Punit-Ganshani-Internet-of-Things-3-Azure-Iot-Suite-Device-Provisioning-Producer-Consumer-and-Reg
I recently did a recording that illustrates the need of NuGet and how to package your libraries with NuGet.
The recording is available on Channel9
Direct Link: https://channel9.msdn.com/Events/APAC-Influencer-Hero-2015/Singapore-Influencer-Showcase/01-Punit-Ganshani-Packaging-your-libraries-with-NuGet
June 22, 2015
Azure, Sessions, TFS, Videos, Visual Studio
azure, channel9, DevOps, session, TFS, visualstudio
I am glad to say that my webcast, that I delivered as part of Southeast Asia MVP ComCamp 2015, has been published on MSDN Channel9
The session outlines the best of cloud world – ALM and Continuous Delivery into Azure platform. The session will focus on configuring VSO, developing applications using VS2015 and running continuous integration (unit tests) and auto deploying the code to Azure Staging and Production platforms.
Direct link: https://channel9.msdn.com/Events/MVPAsiaCommunity/ComCamp2015May/SEA05
For those who are following me on Codetails, would know that I am actively blogging (since Nov 2012) on Codetails on all technology stuff. One of the series of articles I wrote on Codetails that got great applause from the technical community is on Mocking Frameworks with .NET Here are the links that describe the technical details
- Understanding Mock and frameworks – Part 1 of N – Understanding the need of TDD, Mock and getting your application Unit Test ready
- Understanding Mock and frameworks – Part 2 of N – Understanding Mock Stages & Frameworks – Rhino Mocks, NSubstitute and Moq
- Understanding Mock and frameworks – Part 3 of N – Understanding how to Mock Methods calls and their Output – Rhino Mocks, NSubstitute and Moq
- Understanding Mock and frameworks – Part 4 of N – Understanding how to Mock Exceptions and Event Subscriptions – Rhino Mocks, NSubstitute and Moq
And here is my proud moment – featured on Microsoft Channel9