
Functions - PowerShell | Microsoft Learn
Jan 23, 2025 · Learn how to create reusable PowerShell functions, implement best practices, and avoid common pitfalls in function design, error handling, and parameter validation.
about_Functions - PowerShell | Microsoft Learn
Jan 18, 2026 · The following example shows the outline of a function that contains a begin block for one-time preprocessing, a process block data from the pipeline, and an end block for one-time post …
about_Functions_Advanced - PowerShell | Microsoft Learn
Sep 29, 2025 · The following example shows a function that accepts a name and then prints a greeting using the supplied name. Also notice that this function defines a name that includes a verb (Send) …
Examples of Comment-based Help - PowerShell | Microsoft Learn
Mar 24, 2025 · This topic includes examples that demonstrate how to use comment-based help for scripts and functions.
about_Functions_Advanced_Parameters - PowerShell
The following example shows a function with standard parameters named Name and Path, and an optional dynamic parameter named KeyCount. The KeyCount parameter is in the ByRegistryPath …
Everything you wanted to know about ShouldProcess - PowerShell
PowerShell functions have several features that greatly improve the way users interact with them. One important feature that is often overlooked is -WhatIf and -Confirm support and it's easy to add to your …
about_Functions_CmdletBindingAttribute - PowerShell | Microsoft Learn
Mar 24, 2025 · The following example shows the format of a function that specifies all the optional arguments of the CmdletBinding attribute. A brief description of each argument follows this example.
Add Credential support to PowerShell functions - PowerShell
Nov 17, 2022 · This article shows you how to add credential parameters to PowerShell functions and why you'd want to. A credential parameter is to allow you to run the function or cmdlet as a different …
PowerShell developer reference for Azure Functions
A PowerShell Azure function (function) is represented as a PowerShell script that executes when triggered. Each function script has a related function.json file that defines how the function behaves, …
about_Parameter_Sets - PowerShell | Microsoft Learn
Sep 29, 2025 · The following example function counts the number lines, characters, and words in a text file. Using parameters, you can specify the values you want returned and the files you want to measure.