Schedule with us
Complete Course Python, HTML, CSS, JavaScript (Class 4: Power Shell)

Automate Your World with AI

Class 4: Power Shell

Power Shell is an object-oriented automation engine and scripting language with an interactive command line shell that helped Microsoft developed to help IT professionals configure systems and automate administrative tasks.

How to Open PowerShell

What does PowerShell do

Microsoft designed PowerShell to automate system tasks, such as batch processing, and to create system management tools for commonly implemented processes.

Why use PowerShell

PowerShell offers a CLI with a mature and detailed scripting language that enables user with rudimentary programming skills to craft a detailed set of instructions or a script for a desired task. The task can be just about anything, from finding a desired file to describing a desired state configuration for the system or other systems. Once the script is created, it can be saved as a file and executed with a click, enabling the same task to be repeated exactly the same way for any number of repetitions. Different scripts can also be chained together to create complex and highly detailed tasks.

Below is the selection of commonly used commands:

Core commands  

  • Get-Command: Lists all available cmdlets, functions, aliases and other command types
  • Get-Help: Provide detailed information about a specific command including its syntax, parameters and examples
  • Get-Member: Displays the propertiesand methods of an object

File and Folder Management

  • Set-Location (cd): Changes the current directory
  • Get-Children (Is,dir): Lists files and folders with a directory
  • New-Item: Creates new files or folders
  • Copy-Item (cp.copy): Copies files or folders
  • Move-Item (mv): Moves files or folders
  • Remove-Item (del,rm): Deletes files or folders
  • Get-Content (cat,type): Reads the content of a file
  • Set-Content: Writes or replaces the content of a file
  • Add-Content: Appends content to a file

Process Management

  • Get-Process (ps): Lists running processes
  • Start-Process (saps): Starts a new process
  • Stop-Process: Stops a running process
  • Restart-Process: Restarts a running process

Service Management

  • Get-Service: Lists installed services
  • Starts-Service: Starts a service
  • Stop-service: Stops a service
  • Restart-Service: Restart a service
  • Set-Service: modifies service properties

System Information

  • Get-ComputerInfo: Retrieves detailed information about the local computer
  • Get-WinEvent: Displays windows event logs
  • Test-Connection (ping): Checks network connectivity to a remote host

Output and formatting

  • Out-File: Sends command output to a file
  • CovertTo-HTML: Converts objects into HTML format
  • ConvertTO-Json: Converts objects into JSON format
  • Format-Table: Formats output as a table
  • Format-List: Formats output as a list

Remote Management

  • Enter-PSSession: Starts an interactive remote PowerShell session
  • Exit-PSSession: Exits a remote PowerShell session
  • Invoke-Command: Runs commands on local or remote computers

Security and Permissions

  • Get-ACL: Displays access control lists (permissions) for an item
  • Set-ACL: Sets access control lists (permissions) for an item
  • Set-ExecutionPolicy: Manages the script execution policy

Computer Network

A computer network is a system of interconnected devices that can communicate and share resources, data and information. These devices are linked through physical cables or wireless connections and use communication protocols to exchange data.

Examples:

  • Sending emails
  • Accessing Website
  • Streaming Video
  • Sharing printer or local network e.t.c

Types of Network

VPN

It is a secure private network built on the top of the internet.

Example: Employees use VPN to connect safely to their office network from home

Pan

It is a very small network for personal devices.

Example: connecting a smartphone to a laptop using a Bluetooth

LAN

It covers a very small area like a home or a office.

Example: Computers connected in an office building to or home share files

WAN (Wide Area Network)

It covers a very large area, even across countries.

Example: Internet is the biggest WAN in the world

MAN (Metropolitan Area Network)

It covers a city or a large campus.

Example: A university campus network or city-wide cable TV networks

IP address

An IP address (Internet Protocol address) is a unique numerical identifier assigned to every device connected to the internet or a local network, enabling them to communicate and exchange data. It functions like a return address, ensuring information reaches the correct destination. 

Types of IP Addresses

There are several types of IP addresses

  • Public IP Address: This is the primary address for your entire network, assigned by your Internet Service Provider (ISP) and visible to the wider internet. All devices within your network share this single IP address when communicating with the outside world.
  • Private IP Address: Each device within local network (e.g., computers, phones, printers) is assigned a private IP address by your router. These addresses are not routable on the public internet and are only used for internal communication.
  • Dynamic IP Address: Most home users have dynamic IP addresses, which are assigned automatically by the ISP’s Dynamic Host Configuration Protocol (DHCP) server and can change periodically (e.g., after a router reset or lease expiry).
  • Static IP Address: Unlike dynamic addresses, static IP addresses remain constant once assigned. They are typically used by business to host their own servers (like web or email servers) to ensure consistent accessibility.

Networking Devices

Router:

Connects multiple networks together and directs data between them. A common example is connecting a home network to the internet

HUB:

A basic Device that connects multiple devices but broadcasts data to all connected devices, unlike a switch

Access Point (AP):

Allows wireless devices to connect to wired network by creating a wireless local area network (WLAN)

Firewall:

Monitors and controls incoming and outgoing network traffic to protect against unauthorized access