Going Further
Reach .NET directly, share your tools, and know when a script should become a program.
Updated
Beyond Cmdlets
- All of .NET at Your Fingertips (Freelancer): Under every cmdlet is .NET, a library of thousands of ready-made tools, and PowerShell reaches any of them directly: a type in square brackets and :: call its static members, such as [Math]::Round, [IO.Path]::GetExtension and [Guid]::NewGuid(), and Add-Type compiles a few lines of C# into tools of your own.
Sharing
- Sharing Your Tool (Journeyman): A module is ready to share when it has a README that says what it does and how to install it, a version number that follows MAJOR.MINOR.PATCH, and a license that says what others may do with it; Publish-PSResource then packs it into a repository, a folder registered with Register-PSResourceRepository for practice, or the PowerShell Gallery.
- When to Reach for Another Language (Journeyman): PowerShell is at its best as glue: files, Windows, other programs and quick-run applications; a script that grows past a few hundred lines, needs a web page or a phone app, has to run fast over millions of items or runs where PowerShell can't is a sign to look at C#, Python or JavaScript, and the languages work together, passing JSON, rather than taking sides.
Exercise: Share Your Module
- Exercise: Share Your Module (Journeyman): Get the RecipeBox module ready to share with a new version number, a README and the MIT License, publish it to a practice repository with Publish-PSResource, and a Pester check opens the package the way a friend would and makes sure it works.