Intermediate-level learning resources
When you've read all the "30 days of PowerShell" books, and you've done the Write-Host and foreach tutorials, sometimes it's nice to learn some of the more... good things. The things that aren't really discussed in the beginners books because it's usually out of scope for beginners. The things you have to painstakingly learn on your own, or by digging through poorly written blog posts. The things you've heard from someone who's heard from someone who said it was good/bad practice.
This behind-the-scenes information isn't really easily accessible if you don't know it exists, so here are a few links to peruse:
Complete MSDN PowerShell documentation
(I recommend clicking around on MSDN for a bit. It's really got a lot of good things in there these days.)
- Writing a Windows PowerShell Module
- Provides information for administrators, script developers, and cmdlet developers who need to package and distribute their Windows PowerShell solutions.
- Writing a Windows PowerShell Cmdlet
- Provides information for designing and implementing cmdlets.
- Writing a Windows PowerShell Provider
- Provides information for designing and implementing Windows PowerShell providers. It will help you understand how Windows PowerShell providers work, and it provides sample code that you can use to start designing or writing your own providers.
- Writing a Windows PowerShell Host Application
- Provides information that can be used by program managers who are designing host applications and by developers who are implementing them. The host application can, define the runspace where commands are run, open sessions on a local or remote computer, and invoke the commands either synchronously or asynchronously based on the needs of the application.
- Writing a Windows PowerShell Formatting File
- Provides information for the authoring of formatting files, which control the display format for the objects that are returned by commands (cmdlets, functions, and scripts).
- Windows PowerShell Reference
- Provides reference content for the APIs used in writing cmdlets, providers, and host applications, as well as other supporting APIs.
Required Development Guidelines
- Design Guidelines
- Use Only Approved Verbs (RD01)
- Cmdlet Names: Characters that cannot be Used (RD02)
- Parameters Names that cannot be Used (RD03)
- Support Confirmation Requests (RD04)
- Support Force Parameter for Interactive Sessions (RD05)
- Document Output Objects (RD06)
- Code Guidelines
- Derive from the Cmdlet or PSCmdlet Classes (RC01)
- Specify the Cmdlet Attribute (RC02)
- Override an Input Processing Method (RC03)
- Specify the OutputType Attribute (RC04)
- Do Not Retain Handles to Output Objects (RC05)
- Handle Errors Robustly (RC06)
- Use a Windows PowerShell Module to Deploy your Cmdlets (RC07)
Strongly Encouraged Development Guidelines
- Design Guidelines
- Use a Specific Noun for a Cmdlet Name (SD01)
- Use Pascal Case for Cmdlet Names (SD02)
- Parameter Design Guidelines (SD03)
- Provide Feedback to the User (SD04)
- Create a Cmdlet Help File (SD05)
- Code Guidelines
- Coding Parameters (SC01)
- Support Well Defined Pipeline Input (SC02)
- Write Single Records to the Pipeline (SC03)
- Make Cmdlets Case-Insensitive and Case-Preserving (SC04)
Windows PowerShell Error Reporting (part of MSDN PowerShell documentation)
- Error Reporting Concepts
- Describes the two mechanisms that cmdlets can use to report errors.
- Terminating Errors
- Describes the method used to report terminating errors, where that method can be called from within the cmdlet, and exceptions that can be returned by the Windows PowerShell runtime when the method is called.
- Non-Terminating Errors
- Describes the method used to report non-terminating errors and where that method can be called from within the cmdlet.
- Displaying Error Information by Category
- Discusses the ways that users can display error.
- Windows PowerShell Error Records
- Describes the components of an error record.
- Interpreting ErrorRecord Objects
- Discusses how ErrorRecord objects are interpreted.
5 comments · 98% upvoted · other discussions
Mods should sticky this