Powershell Scripting Tutorial
Introduction Tools required for Powershell First Powershell script Interacting with userSpecial characters in Windows Powershell scriptingArrays String manipulation Conditional statements Looping statements Passing arguments Passing named arguments Exit status of the script Writing functionsWriting functions in windows powershell scripting
Functions are used to increase code re-usability. We can create a simple function using below syntax.
function f1
{
echo “hello”
}
f1
Passing arguments to the function Below example shows how you can pass parameters to the function. Note that we have passed a parameter -“firstname”
function f1
{
Param($firstname)
echo “Your name is $firstname”
}
To call above function, you need to use below syntax.
f1 paul
Web development and Automation testing
solutions delivered!!