PowerShell Arrays Deep Dive

Опубликовано: 22 Март 2026
на канале: Go Cloud Easily
2,210
30

This Video is about, detailed discussion on PowerShell Arrays
----------------------------------------------------------------------------------------------------------------
In this complete Section of PowerShell Array , We will cover about many things with demo as mentioned below.
Items marked with hyphen (-- ) has have been covered in other parts of this PowerShell Array section
Items marked with asterisk (**** ) has have been covered in this part (PowerShell Arrays - Part - 01).

✅ POWERSHELL ARRAYS DEEP DIVE - PART 1
   • PowerShell Arrays Deep Dive #PowerShellArr...  

**** What is PowerShell Array 00:04
**** How to declare or create an Array using PowerShell Array Operator 00:55
**** How to declare or create an Array using PowerShell Array Operator -- (DEMO) 01:55
**** How to create an Array without using PowerShell Array Operator 03:29
**** How to create an Array without using PowerShell Array Operator -- (DEMO) 04:03
**** Indexing & Accessing elements of an Array 05:08
**** Indexing & Accessing elements of an Array -- (DEMO) 06:17
**** How to Create Strongly Typed Arrays 08:57
**** How to Create Strongly Typed Arrays -- (DEMO) 09:34

✅ POWERSHELL ARRAYS DEEP DIVE - PART 2
   • PowerShell Arrays Deep Dive #PowerShellArr...  

-- How PowerShell Operators Work with PowerShell Arrays
-- How PowerShell Operators Work with PowerShell Arrays (DEMO)
-- How to Use Properties of PowerShell Array
-- How to Use Properties of PowerShell Array (DEMO)
-- Method of PowerShell Array
-- Clear Method of PowerShell Array (DEMO)
-- Foreach Method of PowerShell Array
-- Foreach Method of PowerShell Array (DEMO)
-- Where Method of PowerShell Array
-- Where Method of PowerShell Array (DEMO)

✅ POWERSHELL ARRAYS DEEP DIVE - PART 3
   • PowerShell Arrays Deep Dive #PowerShellArr...  

-- How to add or remove elements from an Array
-- How to add or remove elements from an Array (DEMO)
-- How to Iterate a script block against all element of an Array
-- How to Iterate a script block against all element of an Array (DEMO)

---------------------------------------------------------------------------------------------------
Commands and Code, that has been Used in this Section is mentioned here, You can please use it to practice.

Creating Array using Array Operator
$fruits = @("Apple","Orange","Kiwi")
$fruits
$Numbers = @(1..12)
$Numbers
$Services = @(Get-Service)
$Services

Creating PowerShell Array by Simply assigning comma separated Value to a Variable
$Multi = "A","b","c"
$Multi
$Single = ,"White"
$Single

How Indexing works for an PowerShell Array
How to access elements of an PowerShell Array
$Numbers
$Numbers[0]
$Numbers[-1]
$Numbers[2..3]
$Numbers[1,3+5..7]
$Numbers[0..3+5..7]

Create Strongly Typed PowerShell Array
$Normal = 1,"b",222,"c"
$Normal
$Normal.GetType()

[int[]]$Strong = 1,"b",222,"c"
[int[]]$Strong = 1,222,2,4
$Strong.GetType()

Get-Process | Get-Member
[System.Diagnostics.Process[]]$Process = Get-Process
$Process.GetType()

PowerShell Operators working with PowerShell Arrays
Join Operator
$Numbers
$Numbers -join,"-"
-join $Numbers

Replace Operator
$fruits
$fruits -replace "orange","banana"

Contains Operator
$fruits -contains "kiwi"

In Operator
"Apple" -in $fruits
$fruits -eq "kiwi"
$fruits -ne "kiwi"

Properties and Methods of an PowerShell Array
$Numbers.Count
$Numbers.Length

$Numbers
$Numbers.Clear()
$Numbers | % {$_ -eq $null}

$Numbers = 1..12
$Numbers
$Numbers.ForEach({$_ * 2})

$fruits
$fruits.ForEach("ToUpper")


$Numbers.Where({$_ -lt 8})
('Yellow', '', 'Black').Where({$_.Length})
$Numbers.Where({$_ -lt 8},"first",0)
$Numbers.Where({$_ -lt 8},"last",2)

$Numbers.Where({$_ -gt 8},"SkipUntil")
$Numbers.Where({$_ -gt 8},"Until")

$running, $stopped = (Get-Service).Where({$_.Status -eq 'Running'}, 'Split')

Manipulate the PowerShell Array
$Numbers
$Numbers += 14
$Numbers
$Numbers[-1] = 16
$Numbers
$Numbers.SetValue(18,1)
$Numbers
$Numbers.RemoveAt(1)
$Numbers.IsFixedSize

[System.Collections.ArrayList]$NewNumbers = 1..5
$NewNumbers.IsFixedSize
$NewNumbers
$NewNumbers.remove(3)
$NewNumbers.removeat(0)
$NewNumbers.Add(100)

Iterating through elements of Array
$NewNumbers
foreach ($number in $NewNumbers)
{$Number * 4}

$NewNumbers
for($i = 0;$i -le $NewNumbers.Count;$i++)
{$NewNumbers[$i] * 5}

************************************************************************
************************************************************************
Join Me on --
Facebook Group
  / mylearningsonline  
Facebook Page
  / mylearningsonline  
YouTube Channel
   / mylearningsonline  

**************************************************************************
#PowerShell #PowerShellScripting #PowerShellForBeginners #learnPowerShell​ #PowerShelltraining​ #PowerShellTutorial #MyLearningsOnline

PowerShell Scripting for Beginners
PowerShell Tutorial for Beginners
PowerShell Full Course
PowerShell Training for Beginners
PowerShell Array Tutorial
PowerShell Array foreach