Skip Ribbon Commands
Skip to main content

Quick Launch

Todd Klindt's home page > Todd Klindt's Office 365 Admin Blog > Posts > Dynamic Parameter Validation in PowerShell
June 22
Dynamic Parameter Validation in PowerShell

Hello, SharePoint and PowerShell enthusiasts! Todd Klindt here, and I've got something exciting to share with you today. I recently had the opportunity to present a developer-focused demo on the Microsoft 365 & Power Platform Community channel. The topic? Dynamic parameter validation in PowerShell.

In this 13-minute demo, I walk you through the process of creating your own PowerShell cmdlet. This cmdlet allows you to pull and tab through information from a site, list, text file, Azure, Graph, etc. within the PowerShell environment.

I utilize the power of ValidateSet, ValidateScript, and ArgumentCompleter. To show off, the demo concludes with an interesting twist. I used ChatGPT to write the same code.

All the code I used in the demo is available on my GitHub repo. You can find it at PoshPnP and PnP PowerShell.

I hope you find this demo useful in your PowerShell journey. Remember, when you're writing PowerShell, try to be the tool maker, not the tool user. Happy coding!

Watch the full video here.

tk

ShortURL: https://www.toddklindt.com/PoshValidation

Comments

Hey Todd!

Hey Todd! Thanks for sharing this—dynamic parameter validation sounds really useful, especially for making cmdlets more user-friendly. I love the idea of using ValidateSet, ValidateScript, and ArgumentCompleter to enhance functionality.

 on 10/7/2024 6:31 AM

It’s cool that you incorporated ChatGPT into your demo

It’s cool that you incorporated ChatGPT into your demo; I’m curious to see how it compared to your own coding style. I checked out your GitHub repo and really appreciate you providing the code for others to learn from. https://hillclimb-racing.com
 on 10/7/2024 6:32 AM

john mark

 on 1/24/2025 11:56 AM

matthew harry

 on 2/1/2025 7:00 AM

harrye dward

 on 2/4/2025 5:42 AM

harry benjamin

 on 2/4/2025 10:46 PM

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Title


Body *


Today's date *

Select a date from the calendar.
Please enter today's date so I know you are a real person

Twitter


Want a message when I reply to your comment? Put your Twitter handle here.

Attachments

 

 SysKit