SlideShare a Scribd company logo
1 of 5
Day 8
Functions in PowerShell
• Functions provide the interface between your code and the user.They
can define parameters, parameter types, and even provide help,
much like cmdlets. A block of code may be contained within a
function for easy re-use.To create a function, call the function
keyword followed by a name for the function, then include your code
inside a pair of curly braces
Function <function_name> (function_parameters) { <function_body> }
Advanced Functions in PowerShell
• Advanced functions - advanced functions gain access to common
Windows PowerShell parameters and other stuff that makes the
function work like aWindows PowerShell cmdlet.The secret? It is the
use of the [cmdletbinding] tag.
Thank you!

More Related Content

What's hot

Mule esb - How to connect to a MySql Database in 5 minutes
Mule esb - How to connect to a MySql Database in 5 minutesMule esb - How to connect to a MySql Database in 5 minutes
Mule esb - How to connect to a MySql Database in 5 minutesGennaro Spagnoli
 
Troubleshooting mule
Troubleshooting muleTroubleshooting mule
Troubleshooting muleSon Nguyen
 
Runmodes and Configs for Fun and Profit
Runmodes and Configs for Fun and ProfitRunmodes and Configs for Fun and Profit
Runmodes and Configs for Fun and ProfitMike Pfaff
 
SCR Annotations for Fun and Profit
SCR Annotations for Fun and ProfitSCR Annotations for Fun and Profit
SCR Annotations for Fun and ProfitMike Pfaff
 
Refactoring merged code - ReSharper meets SemanticMerge
Refactoring merged code - ReSharper meets SemanticMergeRefactoring merged code - ReSharper meets SemanticMerge
Refactoring merged code - ReSharper meets SemanticMergepsluaces
 
Getting anypoint studios all versions
Getting anypoint studios all versionsGetting anypoint studios all versions
Getting anypoint studios all versionsAnirban Sen Chowdhary
 
Idempotent filter in Mule
Idempotent filter in MuleIdempotent filter in Mule
Idempotent filter in MuleF K
 
Automatic documentation with mule
Automatic documentation with muleAutomatic documentation with mule
Automatic documentation with muleF K
 
An Introduction to PowerShell Modules
An Introduction to PowerShell ModulesAn Introduction to PowerShell Modules
An Introduction to PowerShell Modulesjonathanmedd
 
Api testing libraries using java script an overview
Api testing libraries using java script   an overviewApi testing libraries using java script   an overview
Api testing libraries using java script an overviewvodQA
 
Idempotent filter in mule
Idempotent filter in muleIdempotent filter in mule
Idempotent filter in muleMohammed246
 
Deploying and running mule standalone
Deploying and running mule standaloneDeploying and running mule standalone
Deploying and running mule standalonemdfkhan625
 
Top 5 features added to Java 9
Top 5 features added to Java 9Top 5 features added to Java 9
Top 5 features added to Java 9Ankur Srivastava
 

What's hot (17)

Mule esb - How to connect to a MySql Database in 5 minutes
Mule esb - How to connect to a MySql Database in 5 minutesMule esb - How to connect to a MySql Database in 5 minutes
Mule esb - How to connect to a MySql Database in 5 minutes
 
Troubleshooting mule
Troubleshooting muleTroubleshooting mule
Troubleshooting mule
 
Runmodes and Configs for Fun and Profit
Runmodes and Configs for Fun and ProfitRunmodes and Configs for Fun and Profit
Runmodes and Configs for Fun and Profit
 
SCR Annotations for Fun and Profit
SCR Annotations for Fun and ProfitSCR Annotations for Fun and Profit
SCR Annotations for Fun and Profit
 
Refactoring merged code - ReSharper meets SemanticMerge
Refactoring merged code - ReSharper meets SemanticMergeRefactoring merged code - ReSharper meets SemanticMerge
Refactoring merged code - ReSharper meets SemanticMerge
 
Getting anypoint studios all versions
Getting anypoint studios all versionsGetting anypoint studios all versions
Getting anypoint studios all versions
 
Idempotent filter in Mule
Idempotent filter in MuleIdempotent filter in Mule
Idempotent filter in Mule
 
Processing files sequentially in mule
Processing files sequentially in muleProcessing files sequentially in mule
Processing files sequentially in mule
 
Automatic documentation with mule
Automatic documentation with muleAutomatic documentation with mule
Automatic documentation with mule
 
An Introduction to PowerShell Modules
An Introduction to PowerShell ModulesAn Introduction to PowerShell Modules
An Introduction to PowerShell Modules
 
Api testing libraries using java script an overview
Api testing libraries using java script   an overviewApi testing libraries using java script   an overview
Api testing libraries using java script an overview
 
Mule
MuleMule
Mule
 
Idempotent filter in mule
Idempotent filter in muleIdempotent filter in mule
Idempotent filter in mule
 
Mule with velocity
Mule with velocityMule with velocity
Mule with velocity
 
Deploying and running mule standalone
Deploying and running mule standaloneDeploying and running mule standalone
Deploying and running mule standalone
 
Java mule
Java muleJava mule
Java mule
 
Top 5 features added to Java 9
Top 5 features added to Java 9Top 5 features added to Java 9
Top 5 features added to Java 9
 

More from Ashish Raj

GitOps with Argo - Part 1.pdf
GitOps with Argo - Part 1.pdfGitOps with Argo - Part 1.pdf
GitOps with Argo - Part 1.pdfAshish Raj
 
Getting Started with IaC in Azure using ARM Template
Getting Started with IaC in Azure using ARM TemplateGetting Started with IaC in Azure using ARM Template
Getting Started with IaC in Azure using ARM TemplateAshish Raj
 
Power shell basics day 19
Power shell basics day 19Power shell basics day 19
Power shell basics day 19Ashish Raj
 
18 .NET Objects in PowerShell
18 .NET Objects in PowerShell18 .NET Objects in PowerShell
18 .NET Objects in PowerShellAshish Raj
 
Powershell basics day 17
Powershell basics day 17 Powershell basics day 17
Powershell basics day 17 Ashish Raj
 
Cloud quick start
Cloud quick startCloud quick start
Cloud quick startAshish Raj
 
Power shell basics day 16
Power shell basics day 16Power shell basics day 16
Power shell basics day 16Ashish Raj
 
PowerShell basics day 15
PowerShell basics day 15PowerShell basics day 15
PowerShell basics day 15Ashish Raj
 
Power shell basics day 14
Power shell basics day 14Power shell basics day 14
Power shell basics day 14Ashish Raj
 
Power shell basics day 13
Power shell basics day 13Power shell basics day 13
Power shell basics day 13Ashish Raj
 
PowerShell basics day 12
PowerShell basics day 12PowerShell basics day 12
PowerShell basics day 12Ashish Raj
 
Power shell basics day 6
Power shell basics day 6Power shell basics day 6
Power shell basics day 6Ashish Raj
 
Power shell basics day 5
Power shell basics day 5Power shell basics day 5
Power shell basics day 5Ashish Raj
 
Power shell basics day 4
Power shell basics day 4Power shell basics day 4
Power shell basics day 4Ashish Raj
 

More from Ashish Raj (14)

GitOps with Argo - Part 1.pdf
GitOps with Argo - Part 1.pdfGitOps with Argo - Part 1.pdf
GitOps with Argo - Part 1.pdf
 
Getting Started with IaC in Azure using ARM Template
Getting Started with IaC in Azure using ARM TemplateGetting Started with IaC in Azure using ARM Template
Getting Started with IaC in Azure using ARM Template
 
Power shell basics day 19
Power shell basics day 19Power shell basics day 19
Power shell basics day 19
 
18 .NET Objects in PowerShell
18 .NET Objects in PowerShell18 .NET Objects in PowerShell
18 .NET Objects in PowerShell
 
Powershell basics day 17
Powershell basics day 17 Powershell basics day 17
Powershell basics day 17
 
Cloud quick start
Cloud quick startCloud quick start
Cloud quick start
 
Power shell basics day 16
Power shell basics day 16Power shell basics day 16
Power shell basics day 16
 
PowerShell basics day 15
PowerShell basics day 15PowerShell basics day 15
PowerShell basics day 15
 
Power shell basics day 14
Power shell basics day 14Power shell basics day 14
Power shell basics day 14
 
Power shell basics day 13
Power shell basics day 13Power shell basics day 13
Power shell basics day 13
 
PowerShell basics day 12
PowerShell basics day 12PowerShell basics day 12
PowerShell basics day 12
 
Power shell basics day 6
Power shell basics day 6Power shell basics day 6
Power shell basics day 6
 
Power shell basics day 5
Power shell basics day 5Power shell basics day 5
Power shell basics day 5
 
Power shell basics day 4
Power shell basics day 4Power shell basics day 4
Power shell basics day 4
 

Recently uploaded

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 

Recently uploaded (20)

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 

Power shell basics day 8

  • 2. Functions in PowerShell • Functions provide the interface between your code and the user.They can define parameters, parameter types, and even provide help, much like cmdlets. A block of code may be contained within a function for easy re-use.To create a function, call the function keyword followed by a name for the function, then include your code inside a pair of curly braces Function <function_name> (function_parameters) { <function_body> }
  • 3. Advanced Functions in PowerShell • Advanced functions - advanced functions gain access to common Windows PowerShell parameters and other stuff that makes the function work like aWindows PowerShell cmdlet.The secret? It is the use of the [cmdletbinding] tag.
  • 4.