{}const=>[]async()letfn</>var
BasicsDevelopment

How to Work with PowerShell — A Complete Guide for Beginners

If you ever opened a black window with incomprehensible inscriptions and closed it with the words "oh, better not to touch" — congratulations, it was PowerShell. Let's find out how to use it wisely and without fear

К

Kodik

Author

3 min read

🧠 If you ever opened a black window with incomprehensible inscriptions and closed it with the words "oh, better not to touch" — congratulations, it was PowerShell. Today you will learn how to use it wisely and without fear. It will be simple, fun and with memes. Let's go!


What is PowerShell and why do you need it?

PowerShell is a powerful tool from Microsoft for automating tasks and managing the system. Imagine that it's like Google Docs, only for a programmer: everything is under control, everything is automated.

🤔 Why not just Explorer?

Explorer (regular folder window)

PowerShell

Click with the mouse

You write commands ✍️

You are slowly renaming 100 files

You do it with one line of code

You break down when something doesn't work

Fix it through the script

PowerShell can be especially useful if you:

  • Working with a large number of files

  • You often perform the same actions (for example, copying/archiving)

  • Do you want to set up the system once and forget about the routine forever?

👀 PowerShell is like a superpower for your computer. Only instead of the web, there are commands.


🔥 100,000+ students already with us

Tired of reading theory?
Time to code!

Kodik — an app where you learn to code through practice. AI mentor, interactive lessons, real projects.

🤖 AI 24/7
🎓 Certificates
💰 Free
🚀 Start learning
Joined today

How to open PowerShell 🔓

  1. Click Win + R

  2. Write powershell

  3. Press Enter

And you're in business! (Yes, it's that simple. Don't be afraid!)

And if you want to run PowerShell as an administrator:

  • Find PowerShell through Windows search

  • Right-click and select "Run as administrator"

🧙‍♂️ Admin mode opens up even more possibilities (for example, managing services and program settings).


First command: Get-Help

Get-Help

This command is your new best friend. It will tell you what any other command does.

Get-Help Get-Process

If you want to see examples of use:

Get-Help Get-Process -Examples

🧑‍🏫 Joke of the day: PowerShell is like Stack Overflow, only you help yourself.


Useful commands for a beginner 🛠️

Team

What it does

Get-Process

Shows running processes

Stop-Process -Name chrome

Completes the process (for example, closes Chrome)

Get-Service

Shows services in the system

Start-Service / Stop-Service

Starts or stops services

Get-ChildItem

Shows files and folders in the current directory

Set-Location

Go to another folder (analogous to cd)

New-Item

Create a file or folder

Remove-Item

Deleting a file or folder

Copy-Item

Copying files and folders

Move-Item

Moving files and folders


Examples: how to make magic ✨

View all files in the folder:

Get-ChildItem C:\Users\Public

Go to folder:

Set-Location C:\Users\Public

Create a text file:

New-Item -Path . -Name "example.txt" -ItemType "File"

Delete file:

Remove-Item .\example.txt

Rename file:

Rename-Item -Path "old.txt" -NewName "new.txt"

Copy file:

Copy-Item -Path "example.txt" -Destination "backup_example.txt"

Move file:

Move-Item -Path "backup_example.txt" -Destination "C:\Backup"

🤓 Pssst... So you can even automate cleaning on your desktop.


How to write a script 💻

PowerShell scripts are just files with the extension .ps1. You can open Notepad, write commands, save as script.ps1, and then run it.

# Example: a script that creates 3 folders
New-Item -Path . -Name "Project1" -ItemType "Directory"
New-Item -Path . -Name "Project2" -ItemType "Directory"
New-Item -Path . -Name "Project3" -ItemType "Directory"

To start:

.\script.ps1

💡 To make the scripts work, sometimes you need to change the execution policy:

Set-ExecutionPolicy RemoteSigned

Select Y (Yes) and Enter — you're done!

🙈 Joke of the day: PowerShell scripts are like pasta: if you do it right, it tastes good. If not, everything will stick together.


How to automate daily tasks 🤖

Here are some ideas of what you can automate with PowerShell:

🔄 File backup

Copy-Item "C:\Work\*" "D:\Backup\" -Recurse

📅 Creating a daily log

$today = Get-Date -Format "yyyy-MM-dd"
New-Item -Path . -Name "log_$today.txt" -ItemType "File"

🧹 Cleaning the "Downloads" folder from old files:

Get-ChildItem "C:\Users\User\Downloads" | Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-30) } | Remove-Item

🧼 Automatic cleaning is now a reality!


What's next?

If you like PowerShell (and you will!), then here's where to go next:

  • Learn to write more complex scripts

  • Manage remote computers

  • Automate daily tasks (backups, reports, etc.)

  • Use PowerShell with Windows Task Scheduler

  • Work with JSON, CSV, and Excel files through PowerShell

And if you want to learn not only PowerShell, but also other programming languages, try Code! This is a convenient and fun application for learning Python, JavaScript and other languages even from scratch 🧑‍💻📱


🎯Stop procrastinating

Liked the article?
Time to practice!

In Kodik, you don't just read — you write code immediately. Theory + practice = real skills.

Instant practice
🧠AI explains code
🏆Certificate

No registration • No card