Writing Compiled PowerShell Cmdlets
summary
Shows how to write compiled PowerShell cmdlets in C# using the .NET Core SDK and VS Code, adding the PowerShell.Standard.Library package, running dotnet new / dotnet build and importing the resulting DLL as a module. Walks through a hello world cmdlet, consuming a provided DLL, a three parallel tasks multithread demo that runs three 5s sleeps in ~5s (not 15s), LINQ examples on ranges of 10 numbers, and adding a cat-fact cmdlet to PowerShell Core and building a local runtime.
AI-written summary · about
chapters (16)
- 0:00Start
- 1:24Introduction to Powershell Commandlets in C Sharp
- 10:27Powershell Is a Gateway Language
- 11:07Dependencies
- 11:35.Net Core Sdk
- 12:49Create a New Class Library
- 16:01Hello World Example
- 19:45System Management
- 21:37Inheriting from the Ps Commandlet Class
- 32:23Local Nuget Repository
- 41:21When Should You Use Invoke
- 41:43Invoke Multi-Threading
- 55:35Enumerable Range
- 59:00Union
- 1:13:10Intro To Git and Github
- 1:27:04Powershell Discord
related talks
01h 03mThe Zen of Powershell - PowerShell for the C# dev
01h 29mModularizing PowerShell: Making Code Portable
45mPlatform PowerShell
01h 02mPowerShell Core
45mNew Shell in Town: Adventures in using PowerShell on Linux
46mSupercharging PowerShell with LINQ
39mBuilding Cross Platform PowerShell Modules
46mFrom Script to Tool: Building Robust, Meaningful Tools with PowerShell
