In PowerShell the most common method of storing data is to store it in an ‘Array’.Arrays can be initialized using a simple syntax: Array
1 2 3 4 5 6 7 8 9 10 11 12 13 |
#Initialize the array $myarray = @() #add an integer to the array $myarray = $myarray + 1 #add a string $myarray = $myarray + 'Hello World' #add a datetime object $myarray = $myarray + (Get-Date) |
as you can see we can store just about any type of data in an array which can be good and bad. This can lead to errors in situations where […]