Notes 8 31 - Herrscherr0Z/SYS255 GitHub Wiki

Make sure to always use PowerShell ISE

ping -t is a continuous ping get-process is the equivalent to task manager get-member list available properties and functions and methods for a cmdlets ` <= tick is to start the command on a newline select-object lets you select specific properties Path helps you identify if you have malicious code or not make sure to run in administrator because if not it wont show you everything Test-connection = Ping (but for powershell)Test-connection

$to_ping helps create an array of IP addresses

foreach is used to iterate through an array, dictionary, or list

Powershell variables start with a $.

example: $to_ping = "8.8.8.8."

The value 8.8.8.8 is assigned to the variable $to_ping.

Powershell array - Used to store elements

Powershell arrays are initalized with: @()

Example: $to_ping = @('8.8.8.8','8.8.4.4')

foreach loops are used to iterate through an array or list of objects.

Example: $to_ping = @('8.8.8.8','8.8.4.4')

foreach ($ip in $to_ping) {

# Perform operations on each element.
# In order to access each element in the array    
# each element is assigned to the variable $ip **while** it is within this foreach loop.
# After the last instruction has been performed, Powershell will go to the next element
# in the array until there are no more elements and then it will break out of the foreach loop

}