Home / Blog / SIEM and Tools

Beginner SIEM and Tools

PowerShell and Python Lesson 01: Your First Commands

Install PowerShell 7, Python and VS Code, then run your first commands to print the date, time and computer name. Lesson 1 of a 26 week series.

Lesson 01 of 26, Month 1: First steps. By the end of this lesson you will have PowerShell 7, Python 3 and VS Code installed, and you will have run your first commands.

Why this matters on shift

  • Handover notes need exact times and machine names. Typing them by hand invites mistakes.
  • The same small checks come up again and again, such as "what time is it on this server?" A script can answer in one second.
  • A script does the boring part the same way every time, so you spend your attention on the alert.

The idea in plain English

A script is a list of instructions a computer follows in order. PowerShell is a command line shell and scripting language. As far as I could verify on Microsoft Learn, it runs on Windows, Linux and macOS. A command is one instruction you type and run by pressing Enter. Python is a second, very popular scripting language, and VS Code (Visual Studio Code) is a free editor for writing scripts.

Version note, as far as I could verify in November 2026: the PowerShell support lifecycle page lists 7.6.6 as the current long term support (LTS) release, and the Python downloads page lists Python 3.15.2 as the latest. Your numbers may be newer. Newer is fine.

Safety: practise on your own computer or a lab virtual machine, never on a work system without permission, and never run scripts copied from unknown websites. Every output below uses made up data for illustration.

Try it step by step

  1. Install PowerShell 7 using the official install guide. On Windows, Microsoft lists WinGet as the recommended method. On Linux or macOS, follow the matching page from the same guide.
  2. Install Python 3 from the official Python downloads page.
  3. Install Visual Studio Code, which its page describes as free.
  4. Check each install and run your first commands, using the three blocks below.

First, install and start PowerShell 7 on Windows:

winget install --id Microsoft.PowerShell --source winget
pwsh
  • Line 1 asks WinGet, the Windows package installer, to install PowerShell 7.
  • Line 2 starts PowerShell 7. The program is called pwsh, not powershell.

What you should see: a progress message, then a new prompt that starts with PS.

Next, check the versions:

$PSVersionTable.PSVersion
python --version
  • Line 1 shows the PowerShell version. $PSVersionTable is a built in variable, a named box that holds information about your session. The dot then picks out the PSVersion item.
  • Line 2 asks Python to print its version and stop. On some Windows setups the command is py instead of python.

What you should see: a version such as 7.6.x, then a line like Python 3.x.x.

Now run your first commands:

Get-Date
Write-Output "Hello, SOC"
Get-Date -Format "yyyy-MM-dd HH:mm:ss"
[System.Environment]::MachineName
  • Line 1 is a cmdlet (a built in PowerShell command). Get-Date prints the current date and time.
  • Line 2 sends the text in quotes to the output. Quotes mark text.
  • Line 3 adds -Format, an option that sets how the date looks. Here it prints year, month, day, then hours, minutes, seconds.
  • Line 4 asks the .NET platform that PowerShell is built on for the computer's name.

What you should see: a long date, the words Hello, SOC, a date like 2026-11-22 09:30:05, then a name such as WS-114.

Same idea in Python

Python is optional for this lesson, but it is worth seeing the same idea side by side.

from datetime import datetime
import platform
print("Hello, SOC")
print(datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
print(platform.node())
  • Lines 1 and 2 import tools that are not loaded by default. An import is like taking a tool out of a toolbox.
  • Line 3 prints text, using Python's built in print function.
  • Line 4 gets the current time and formats it, using the same year, month, day pattern idea with different symbols.
  • Line 5 prints the computer's network name.

Save it as hello.py and run it with python hello.py.

Your small task (5 to 15 minutes)

In PowerShell, print your first name using Write-Output, then print today's date in the form year-month-day only. A correct result is two lines, for example Ben and then 2026-11-22.

Mini project (30 to 60 minutes)

Build the start of your toolkit. Create a folder called C:\SOC-Toolkit (or ~/soc-toolkit on Linux and macOS) using your file manager.

  • Print the date and time on one line and the computer name on another.
  • Run it in the console and check both lines look right.
  • Save the commands in a text file called shift-info.txt in your toolkit folder. Lesson 12 turns notes like this into real script files.
  • Repeat it in Python and save it as shift_info.py.

Hint: reuse the third and fourth commands from the step by step part.

Check your answer

Write-Output "Ben"
Get-Date -Format "yyyy-MM-dd"
  • Line 1 prints the name. Swap in your own.
  • Line 2 prints only the date, because the format has no time symbols.

Progress check

  • You can now install PowerShell 7, Python and VS Code.
  • You can now run a cmdlet and print text with Write-Output.
  • You can now print the date, time and computer name in PowerShell and Python.

Next lesson: Cmdlets and the Verb-Noun pattern, Get-Help, Get-Command and Get-Member.

Written by Ben, Cybersecurity Student, member of Cyber Talent Incubator Network (CTIN) Cohort

Keep going

More in SIEM and Tools

IntermediateSIEM and Tools

What an Agentic SOC Is and Where Human Approval Fits

AI triage agents are reaching SOC queues. Learn what an agentic SOC is, how NCSC oversight models apply, and where analysts approve, review and own the outcome.

9 Nov 20268 min read