KB of Everything
  • Knowledge Base of Theory
  • Azure Services
    • Quick Overview
  • 70-533: IMPLEMENTING AZURE INFRASTRUCTURE SOLUTIONS
    • Azure Virtual Machines - Introduction
    • Azure Virtual Machines - Availability
    • Azure Virtual Machine - Storage
    • Azure Virtual Machine - Operations
    • Azure Automating Virtual Machine Configuration
  • DevOps
    • Cloud
    • SDLC
    • DevOps
    • CI\CD
    • Microsoft SQL Availability
  • Powershell
    • Powershel interview questions
    • Understanding a Windows PowerShell Module
    • Functions
    • Understanding and using objects in PowerShell
    • PowerShell Basics: Custom Objects
    • Parallel processing with PowerShell
  • Monitoring
    • Short Guide
  • ITIL
    • ITIL CORE
    • Service Operation
    • Service Operation: Event Management
    • Service Operation: Incident Management
    • Service Operation: Problem Management
    • Service Operation: Request Fulfillment
    • Service Operation: Access Management
    • Change Management
    • Release/deployment management
  • Methodologies
    • Agile Methodology
    • Scrum Methodology
    • Waterfall Methodology
    • Kanban
    • Agile vs Scrum
    • Kanban vs Scrum
    • Agile vs Waterfall
    • Kanban vs Agile
  • EPAM
  • Testing
    • Fake Stube Mocking
    • Types of Software Testing: Different Testing Types with Details
Powered by GitBook
On this page

Was this helpful?

  1. Powershell

Functions

PreviousUnderstanding a Windows PowerShell ModuleNextUnderstanding and using objects in PowerShell

Last updated 6 years ago

Was this helpful?

LONG DESCRIPTION

A function is a list of PowerShell statements that has a name that you assign. When you run a function, you type the function name. The statements in the list run as if you had typed them at the command prompt.

Functions can be as simple as:PowerShellCopy

function Get-PowerShellProcess {Get-Process PowerShell}

or as complex as a cmdlet or an application program.

Like cmdlets, functions can have parameters. The parameters can be named, positional, switch, or dynamic parameters. Function parameters can be read from the command line or from the pipeline.

Functions can return values that can be displayed, assigned to variables, or passed to other functions or cmdlets.

The function's statement list can contain different types of statement lists with the keywords Begin, Process, and End. These statement lists handle input from the pipeline differently.

A filter is a special kind of function that uses the Filter keyword.

Functions can also act like cmdlets. You can create a function that works just like a cmdlet without using C# programming. For more information, see .

about_Functions_Advanced