About 50 results
Open links in new tab
  1. 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.

  2. 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 …

  3. 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) …

  4. 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.

  5. 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 …

  6. 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 …

  7. 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.

  8. 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 …

  9. 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, …

  10. 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.