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 functionsArrays in windows powershell scripting
We can create arrays using below syntax.
$cities = @(“Brisbane”,”Perth”,”Sydney”)
Use below syntax to access first element in an array.
echo $cities[0]
Use below syntax to access last element in an array.
echo $cities[-1]
To add an element in an array, you can use below command.
$cities = $cities + “Hobart”
Below image shows how you can work with arrays in Windows Powershell.Web development and Automation testing
solutions delivered!!