PowerShell Introduction

This is basic content and syntax of PowerShell.

Mainly PowerShell 5.0 or later, with some content related to PowerShell Core.


How to check Help

There are several ways to check the Help for PowerShell cmdlets.

How to check members

To check the members, use Get-Member

Commandlet

About commandlet in PowerShell.

Aliases

Alias for PowerShell cmdlet.

Command

There are several ways to run external commands in PowerShell

Strings

In PowerShell, single quotes (’) and double quotes (") are used to represent strings.

Special Characters

In PowerShell, back-quotes (`) are treated as special character strings.

Pipeline

Using the pipeline symbol “|”, multiple commands can be linked together.

Arrays

Arrays are defined as comma separated

Hash Table

Using a hash table, you can store information as a set of keys and values.

Looping

for / foreach / while / do…while / do…until / Flow control

Variables and Types

Operators

Operators in PowerShell

Conditional statement

if~elseif~else / switch

PSDrive

In PowerShell, various items are treated as PSDrive.

Environment variables

Environment variables are treated as an item of the Env drive in the PS drive.

Script Execution Policy

Set the script execution policy to control the script execution behavior.

Scripts

A basic explanation of scripting in PowerShell.

Function

Using functions, you can combine all related processes into one.

Error Handling

try~catch~finally / Automatic variables $? and $ErrorActionPreference / trap / throw

Class & Enum

You can define Class and Enum.

Module

The system for adding cmdlets, functions, etc.

Remoting

How to communicate and control between multiple PCs with PowerShell