Tool.Yun
Công cụ cho nhà phát triển.
Bộ chuyển đổi dBm mW
Bộ chuyển đổi nhiều đơn vị
Bộ chuyển đổi số La Mã
Bộ chuyển đổi thuộc tính
Bộ chuyển đổi đơn vị lưu trữ dữ liệu
Bộ chuyển đổi định dạng biến Env
Bộ mã hóa/giải mã mảng Hex Base64
Chuyển đổi cơ số số nguyên
Chuyển đổi ký tự Unicode sang thực thể Java
Chuyển đổi văn bản thành Unicode
Chuyển đổi văn bản thành nhị phân ASCII
Csv sang Dữ liệu
Công cụ chuyển đổi tọa độ địa lý
Excel thành dữ liệu
Tiêu thụ năng lượng và chi phí máy tính
Torrent đến Nam châm
Trình chuyển đổi tệp Base64
Trình chuẩn hóa email
Trình mã hóa/giải mã chuỗi Base64
Tạo ULID
Bánh xe may mắn
Người lăn xúc xắc
Người lật đồng xu
Người nhặt thẻ
Bộ chuyển đổi Docker Compose sang Docker run
Bộ chuyển đổi định dạng Docker Compose
Chuyển đổi lệnh docker run thành tệp docker-compose
Docker Compose thành Quadlets
Docker Compose thành tệp .env
Docker chạy đến Quadlets
Docker chạy đến kubernetes
Docker compose thành Kubernetes
Docker kiểm tra để chạy Docker
Nhãn Docker Pangolin
Traefik Docker Compose Maker
Trình tạo RBAC Kubernetes
Trình tạo nhãn Dockerfile
Trình tải xuống ảnh Docker
Trình xác thực Docker Compose
Bộ chuyển đổi chữ hoa RMB
Bộ chuyển đổi tiền tệ
Công cụ chuyển đổi lịch
Công cụ tìm kiếm ISO 639
Công cụ tìm kiếm mã quốc gia ISO 3166
Công cụ tính toán tốc độ chạy
Giải thích lệnh Shell
Hướng dẫn chiếu sáng IES
Khả năng tương thích giấy phép phần mềm
Kiểm tra thẻ tín dụng
Kiểm tra và phân tích số IBAN
Máy tính BMI
Máy tính SLA
Trình phân tích và định dạng số điện thoại
Trình xác thực Luhn
Trình xác thực số VAT
Trình xác thực và phân tích ISBN
Tìm kiếm Unicode
Từ điển trực tuyến
Chuyển đổi Epub sang Markdown
Chuyển đổi Markdown thành dữ liệu
Chuyển đổi Markdown thành văn bản
Công cụ tạo bảng Markdown
Dán dưới dạng Markdown
HTML để đánh dấu
Markdown Lorem Ipsum
Markdown sang DOCX
Markdown sang HTML
So sánh Markdown
Trình chỉnh sửa Markdown
Trình làm đẹp bảng Markdown
Trình tạo mục lục Markdown
Xem trước Markdown
tools.markdown-format-converter.name
Bộ biến đổi màu hình ảnh
Bộ chuyển đổi HEIC
Bộ chuyển đổi ICO/PNG
Bộ chuyển đổi định dạng hình ảnh
Chuyển đổi GIF sang MP4
Cắt ảnh
Dấu mờ
Ghi lại camera
Hình ảnh sang SVG (potrace)
OCRize hình ảnh và PDF
So sánh hình ảnh
Thay đổi kích thước hình ảnh
Trình xem trước SVG
Trình đọc chất lượng hình ảnh EXIF/Siêu dữ liệu/GPS/JPEG
Xóa EXIF
Xóa nền ảnh
Bộ chuyển đổi JS sang JSON
Bộ chuyển đổi JSON sang JS
Bộ chuyển đổi chuỗi JSON
CSV sang JSON
Chuyển đổi JSON sang TOML
Chuyển đổi JSON sang TS
Chuyển đổi JSON sang YAML
Chuyển đổi JSON sang tệp .env
Chuyển đổi JSON thành CSV
Chuyển đổi Json sang SQL DDL
Chuyển đổi ObjGen sang JSON
Giảm kích thước JSON
Gói tin nhắn thành JSON
JSON sang C#
JSON sang MessagePack
JSON sang XML
JSON sang thực thể Java
JSON thành Dữ liệu
JSON thành đối tượng
JSON để đi
Json Escaper/Unescaper
Json sang Python
Json thành Schema
Json thành mảng PHP
Mã Json sang PHP
PHP-Mảng thành JSON
So sánh JSON
Sáp nhập JSON
Sắp xếp JSON
Truy vấn JSON
Trình kiểm tra Jq/JSONPath
Trình kiểm tra lỗi JSON
Trình làm phẳng/gỡ phẳng JSON
Trình phân tích kích thước JSON
Trình soạn thảo JSON
tools.json-patch.name
Định dạng và làm đẹp JSON
Bộ chuyển đổi UUID
Máy tạo NanoID
Máy tạo mã PIN
Máy tạo số ngẫu nhiên
Trình tạo BIP39 passphrase
Trình tạo Numeronym
Trình tạo UUID
Trình tạo mã thông báo
Trình tạo mật khẩu
Trình tạo mật khẩu Diceware
Tạo mã OTP
Argon2 Hasher
Bcrypt
Bộ chuyển đổi chứng chỉ SSL
Bộ mã hóa/giải mã Bech32
Chia sẻ bí mật của Shamir
File Hasher
Giải mã JWT
Giải mã hầm chứa Ansible
Máy phát điện JWT
Máy tính CRC
Máy tạo HMAC
Mã hóa / giải mã văn bản
Mã hóa PGP
Mã hóa RSA
Mã hóa chuỗi Jasypt
Mã hóa tập tin PGP
Mã hóa văn bản
Mật mã AGE
Người ký và xác minh RSA/DSA/ECDSA
Niceware Bytes thành Mật khẩu
PGP keygen
Paseto/PASERK Công cộng/Tư nhân
Paseto/PASERK Địa phương
Trình phân tích chứng chỉ/khóa
Trình phân tích cú pháp SAML
Trình tạo CSR
Trình tạo chứng chỉ X509
Trình tạo cặp khóa ECDSA
Trình tạo cặp khóa Ed25519
Trình tạo cặp khóa RSA
Bộ giải mã mã QR
Máy tạo mã vạch
Máy đọc mã vạch
Trình tạo thông tin liên hệ QR
Trình xác thực GTIN
Tạo mã QR
Tạo mã QR WiFi
tools.epc-qrcode-generator.name
Bảng gian lận ZPool
Bộ chuyển đổi Punycode
Bộ chuyển đổi địa chỉ Ipv6
Bộ chuyển đổi địa chỉ MAC
Bộ giải mã ARPA
Bộ giải mã X-VR-SpamCause
Bộ phân tích độ mạnh mật khẩu
Bộ tuyến tính hóa lệnh Shell
Bộ tạo lệnh UFW
Bộ tạo lệnh tắt máy
Chuyển đổi địa chỉ Ipv4
Có chất khử trùng
Công cụ kiểm tra cổng TCP/UDP
Công cụ tính toán mạng con trực quan
IPv4-6/IPRange/CIDR trong IPRange/CIDR/IPMask
Kiểm tra Websocket
Kiểm tra Whois
Máy kiểm tra micrô
Máy phát WPA PSK
Máy tính Chmod
Máy tính HDD
Máy tính RAID
Máy tính RAID ZPOOL
Máy tính loại trừ mạng con IP
Máy tính mạng con IPv4
Máy tính mạng con IPv6
Máy tính phạm vi CIDR sang IP của Ipv4/6
Máy tính phạm vi IPv4/6 đến CIDR(s)
Máy tính tốc độ truyền dữ liệu
Máy tính độ tin cậy RAID
Mở rộng dải IPv4
Ping
Số cổng
Số nguyên cho IPv4/IPv6
Tra cứu địa chỉ MAC
Truy vấn DNS
Truy vấn DNS/RDAP của Cloudflare
Trình kiểm tra DNSBL
Trình liệt kê mạng con IPv4
Trình tạo Apache LogRotate
Trình tạo Crontab
Trình tạo DNS BIMI
Trình tạo DNS DKIM
Trình tạo DNS DMARC
Trình tạo DNS PTR
Trình tạo DNS SPF
Trình tạo FStab
Trình tạo HTAccess
Trình tạo Iptables
Trình tạo Option43
Trình tạo Rsync
Trình tạo cấu hình Wireguard
Trình tạo htpasswd/htaccess
Trình tạo lệnh Curl
Trình tạo số cổng ngẫu nhiên
Trình tạo địa chỉ IPv6 ULA
Trình tạo địa chỉ MAC
Trình tải xuống nhiều liên kết
Trình định dạng Nginx
Trình định dạng lệnh Shell
Tạo mã xác thực cơ bản
Vị trí địa lý IP
tools.restic-command-generator.name
tools.url-redirection-checker.name
trình tạo dòng lệnh firewalld
Địa chỉ IP của tôi
Độ mạnh của mật khẩu Zxcvbn
Ủy quyền SIP
Trình tạo biểu thức Cron
Báo thức Cron/Ngày trong tuần
Báo thức thời gian
Bộ chuyển đổi múi giờ
Bộ chuyển đổi số tuần
Chuyển đổi ngày-tháng
Máy phát điện ICAL
Máy tính ETA
Máy tính Ngày + Thời lượng
Máy tính TTL
Máy tính ngày
Máy tính thời lượng
Ngày nào?
Sáp nhập iCal
Trình phân tích tệp ICAL
Đếm ngược
Đồng hồ bấm giờ
Chuyển đổi HTML sang PDF
Giải mã và mở khóa PDF
Kiểm tra chữ ký PDF
Mã hóa PDF
Pdf Linearize/FastWeb
Trình nén PDF
Trình nối PDF
Trình trích xuất trang PDF
Trình trích xuất văn bản PDF
Bảng gian lận Bash
Bảng gian lận Jq
Bảng gian lận K8s
Bảng hướng dẫn Docker
Bảng hướng dẫn Git Semantic Commit
Bảng hướng dẫn Markdown
Bảng hướng dẫn Regex phổ biến
Bảng hướng dẫn VIM
Bảng hướng dẫn cú pháp JSONPath
Bảng hướng dẫn cú pháp XPath
Bảng hướng dẫn lệnh chmod
Bảng hướng dẫn sử dụng Nginx
Bảng hướng dẫn sử dụng Regex
Bảng hướng dẫn sử dụng bộ chọn CSS
Bảng tóm tắt PowerShell
Bảng tóm tắt các lệnh Tmux
Bảng tóm tắt các lệnh Zellij
Bảng tóm tắt lệnh màn hình
Lệnh Git
Nano CheatSheet
Phiếu gian lận Sed
Tài liệu hướng dẫn Docker Compose
Tài liệu hướng dẫn Docker SWARM
Tài liệu hướng dẫn Dockerfile
Bảng điều khiển cổng nối tiếp
Bộ chuyển đổi GZip/Deflate
Bộ chuyển đổi Middle-Endian
Bộ chuyển đổi ObjectId MongoDB
Bộ chuyển đổi SMART Raw
Bộ chuyển đổi mã hóa MIME
Bộ chuyển đổi số dấu phẩy động
Bộ giải mã EMV TLV
Bộ giải mã Outlook Safelink
Bộ giải mã URL chia sẻ Sharepoint
Bộ giải mã giao dịch ETH
Bộ mã hóa/giải mã Hex
Bộ phát hiện/giải mã ký tự văn bản
Che giấu dữ liệu nhạy cảm
Công cụ kiểm tra DNS
Công cụ kiểm tra HTTPS
Công cụ kiểm tra sự lan truyền DNS
Công cụ kiểm tra điểm ảnh chết
File Parquet Reader
Hướng dẫn nhanh đấu dây RJ45 Cat6
Máy trích xuất ID bông tuyết
Máy tính điện trở
Mở rộng URL ngắn
Thông tin Keycode
Trình phát hiện loại tệp
Trình phân tích MSG của Outlook
Trình phân tích URL
Trình phân tích báo cáo DMARC
Trình phân tích cookie
Trình phân tích email
Trình phân tích email trả lại
Trình tìm kiếm thuộc tính LDAP của ActiveDirectory
Trình tạo TCPDump
Trình tạo URL
Trình tạo lệnh Nmap
键盘测试器
Bộ chia tệp
Bộ chuyển đổi Curl
Bộ chuyển đổi báo giá
Bộ chuyển đổi tệp HEX
Bộ thoát dây
Công cụ tô sáng mã/tập lệnh
Công cụ tạo cơ sở dữ liệu
Công cụ tạo kịch bản kiểm thử tải K6
Json sang SQL INSERT
Json sang Typescript
Json thành Protobuf
Kiểm tra API
Kiểm tra giao diện người dùng Swagger
Kiểm tra thoát ANSI
Kẻ làm giả dữ liệu
Làm đẹp và thu nhỏ CSS/JS
Máy kiểm tra Picomatch
Stacktrace đẹp hơn
Trình giải mã Javascript/Trình giải nén
Trình làm xáo trộn Javascript
Trình làm đẹp Javascript
Trình soạn thảo lệnh CLI
Trình thu nhỏ SQL
Trình tạo GitIgnore
Trình tạo Mailto
Trình tạo biểu tượng yêu thích
Trình tạo bí mật Django
Trình tạo bảng cơ sở dữ liệu
Trình tạo chuỗi kết nối cơ sở dữ liệu
Trình tạo meta Open Graph
Trình tạo tham số SQL
Trình tạo thuộc tính Git
Định dạng và làm đẹp SQL
Đồng hồ bấm giờ Pomodoro
Chuyển đổi TOML thành JSON
Chuyển đổi TOML thành YAML
TOML Linter
Bộ chuyển đổi định dạng toán học
Công cụ trực quan hóa đường cong lượng giác/phương trình
Máy tính nhị phân
Máy tính tiền boa
OCR toán học
Trình đánh giá toán học
Máy tính khấu hao
Bộ chia lời nhắc AI
Bộ chuyển đổi bố cục bàn phím
Bộ chuyển đổi mã Morse
Bộ chuyển đổi rune
Bộ chọn biểu tượng cảm xúc
Bộ mã hóa/giải mã mã thông báo GPT
Chuyển đổi chữ hoa/chữ thường
Chuyển đổi văn bản thành bảng chữ cái NATO
Công cụ ước tính mã thông báo GPT
Gói tập tin cho AI
Hình ảnh thành nghệ thuật ASCII
JSON sang TOON
Kiểm tra I và L
Kiểm tra Regex
Máy phát điện/Biểu ngữ Zalgo
Máy tính Levenshtein
Máy tạo văn bản Lorem ipsum
Mã hóa chuỗi
Người chia sẻ liên kết xã hội
Phím Tab để chuyển đến khoảng trắng
RSVP Reader
So sánh danh sách
So sánh phông chữ
So sánh văn bản
Sơ đồ cấu trúc thư mục
TOON sang JSON
Thống kê văn bản
Trình chuyển đổi danh sách
Trình chọn dòng ngẫu nhiên
Trình dịch văn bản
Trình thay thế văn bản thông minh và ngắt dòng
Trình tìm kiếm dòng trùng lặp
Trình tạo lệnh Sed
Trình tạo trích dẫn
Trình tạo văn bản nghệ thuật ASCII
Trình định dạng Unicode
Trích xuất văn bản từ HTML
Từ ngữ riêng biệt
Unicode sang GSM-7
Văn bản thành tên Unicode
Xuất khẩu nàng tiên cá
Bộ chuyển đổi gia tốc
Bộ chuyển đổi lưu lượng thể tích
Bộ chuyển đổi nhiệt độ
Bộ chuyển đổi năng lượng thực phẩm
Bộ chuyển đổi tiền tố SI
Bộ chuyển đổi tần số
Bộ chuyển đổi tốc độ
Bộ chuyển đổi điện
Bộ chuyển đổi đơn vị chiều dài
Bộ chuyển đổi đơn vị diện tích
Bộ chuyển đổi đơn vị góc
Bộ chuyển đổi đơn vị khối lượng
Bộ chuyển đổi đơn vị lực
Bộ chuyển đổi đơn vị năng lượng
Bộ chuyển đổi đơn vị thể tích
Bộ chuyển đổi đơn vị áp suất
Bộ chuyển đổi độ rọi
Máy tính thể dục
Bánh xe màu
Bộ chuyển đổi CSS XPath
Bộ chuyển đổi pixel REM
Bộ chuyển đổi đơn vị CSS
Chuyển đổi HTML sang XHTML
Chuyển đổi HTML sang dữ liệu
Chuyển đổi chuỗi thành slug
Hình ảnh sang CSS
Kiểm tra độ tương phản màu
Loại Mime
Mã hóa/giải mã chuỗi định dạng URL
Mã trạng thái HTTP
Thay thế các ký tự HTML
Thông tin thiết bị
Trình bắt URL
Trình chuyển đổi màu
Trình dọn dẹp HTML
Trình dọn dẹp URL
Trình làm đẹp CSS
Trình làm đẹp HTML
Trình phân tích User-agent
Trình soạn thảo HTML WYSIWYG
Trình thu nhỏ HTML
Trình tạo Gradient CSS
Trình tạo URL UTM
Trình tạo hình ảnh SVG giả định
Trình tạo đoạn tìm kiếm văn bản URL
Chuyển đổi ObjGen sang HTML
Kiểm tra XPath
Kiểm tra XSLT
Trình kiểm tra lỗi XML
XML sang JSON
Định dạng XML
Sáp nhập YAML
Trình chuyển đổi YAML sang JSON
Trình làm phẳng/bật YAML
YAML sang TOML
Định dạng và làm đẹp YAML
Máy tính khoảng cách địa lý
Máy tính phần trăm
Máy tính tỷ lệ khung hình
Trình tạo bảng đánh giá

Bảng tóm tắt PowerShell

PowerShell là một ngôn ngữ lập trình kịch bản và trình thông dịch dòng lệnh mạnh mẽ được thiết kế cho quản trị hệ thống và tự động hóa. Nó cung cấp một loạt các cmdlet và tính năng cho phép người dùng quản lý và tự động hóa các tác vụ trên hệ thống Windows một cách hiệu quả.

PowerShell is a shell and scripting language built on .NET. Unlike POSIX shells it passes objects down the pipeline rather than text, so Get-Process | Sort-Object CPU sorts real numbers instead of parsing columns.

ℹ️ PowerShell 7+ (pwsh) is cross-platform and current; Windows PowerShell 5.1 (powershell.exe) ships with Windows and is in maintenance. Check with $PSVersionTable.

🔎 Finding Your Way

# what commands exist for a noun?
Get-Command *service*
Get-Command -Module Microsoft.PowerShell.Management

# help, with the part everyone actually wants
Get-Help Get-ChildItem -Examples
Get-Help Get-ChildItem -Full
Update-Help

# what properties and methods does this object have?
Get-Process | Get-Member

# what did that command actually return?
Get-Process | Select-Object -First 1 | Format-List *

📦 Variables

SyntaxDescription
$var = "string"Assign a variable
[int]$var = 5Strongly typed variable
[ValidateRange(1,9)][int]$x=1Typed and constrained
$a, $b = 'a', 'b'Assign several at once
$a, $b = $b, $aSwap two values
$global:var = "v"Scope: global, script, local, private
${my var}A name containing spaces or punctuation
$env:PATHAn environment variable
Remove-Variable xDelete a variable

📚 Arrays

SyntaxDescription
"a","b","c"Array of strings
@()Empty array
,"hi"Array of exactly one element
1,(2,3),4Nested array
$arr[5]Sixth element (0-based)
$arr[2..20]A range of elements
$arr[-1]The last element
$arr[-3..-1]The last three
$arr[1,4+6..9]Positions 1, 4 and 6–9
$arr[($arr.length-1)..0]Reversed
@(Get-Process)Force a single result into an array
$z = $arrA + $arrBConcatenate
$list = [System.Collections.Generic.List[int]]::new()A growable list — much faster than += in a loop

🗂 Hash Tables

SyntaxDescription
$hash = @{}Empty hash table
@{foo=1; bar='two'}Initialise with values
[ordered]@{a=1; b=2}Keeps insertion order
$hash.key1 / $hash["key1"]Read a value
$hash.key1 = 1Write a value
$hash.Remove("key1")Delete a key
$hash.ContainsKey("key1")Test for a key
$hash.GetEnumerator() | Sort-Object KeyIterate in key order
[pscustomobject]@{x=1; z="z"}Turn a hash into an object

🔤 Strings

SyntaxDescription
"$var expands"Double quotes interpolate
'$var does not'Single quotes are literal
"Total: $($items.Count)"$( ) evaluates an expression inside a string
"{0} of {1}" -f $a, $bThe format operator
"col1`tcol2`n"`t tab, `n newline, ` escapes
@"…"@ / @'…'@Here-string, expanding / literal
"abc".ToUpper().NET methods work on strings
$s -split ',' / $a -join ','Split and join
$s.Trim() / .PadLeft(5)Trim and pad
$s -replace 'a','b'Regex replace

💬 Comments & Escaping

# a single-line comment

<#
  a block comment, also used for help text
#>

# the backtick is the escape character
Write-Output "He said `"hi`""
Write-Output "line one`nline two"

# and the line-continuation character
Get-ChildItem -Path C:\ `
              -Recurse `
              -Filter *.log

📁 Files & Paths

CommandDoes
Get-Location (pwd)Current directory
Set-Location (cd)Change directory
Get-ChildItem (ls, dir)List a directory
Get-Content (cat)Read a file
Set-Content / Add-ContentOverwrite / append
Out-File / Out-Null / Out-StringWrite to a file / discard / stringify
New-Item -ItemType DirectoryCreate a file or folder
Copy-Item / Move-Item / Rename-Item / Remove-ItemCopy, move, rename, delete
Test-PathDoes it exist?
Split-Path -ParentThe directory part of a path
Join-Path a bBuild a path portably
Resolve-PathExpand to a full path
Get-FileHash file.zipChecksum a file
# read a large file line by line without loading it all
Get-Content big.log -ReadCount 1000 | ForEach-Object { $_ }

# tail -f
Get-Content app.log -Wait -Tail 20

# every .log modified in the last day
Get-ChildItem C:\logs -Recurse -Filter *.log |
  Where-Object LastWriteTime -gt (Get-Date).AddDays(-1)

🔀 Flow Control

if ($x -eq 5) { "five" } elseif ($x -gt 5) { "more" } else { "less" }

while ($x -lt 10) { $x; $x++ }

do { $x++ } while ($x -lt 10)

for ($i = 0; $i -lt 10; $i++) { $i }

foreach ($file in Get-ChildItem C:\) { $file.Name }

1..10 | ForEach-Object { $_ * 2 }

# parallel, PowerShell 7+
1..10 | ForEach-Object -Parallel { Start-Sleep 1; $_ } -ThrottleLimit 5

switch ($value) {
  'a'       { 'letter a'; break }
  { $_ -gt 10 } { 'big' }
  default   { 'something else' }
}

⚖️ Operators

OperatorMeaning
= += -= *= /= %= ++ --Assignment
-eq / -neEqual / not equal
-gt -ge -lt -leNumeric comparison
-and -or -xor -not !Logical
-like / -notlikeWildcard match (*, ?)
-match / -notmatchRegex match — fills $Matches
-replace 'a','b'Regex replace
-contains / -inArray membership, either way round
-split / -joinSplit a string / join an array
-is / -isnot / -asType test and conversion
-fFormat a string
..Range
$( ) / @( )Sub-expression / array sub-expression
& / .Invoke a command / dot-source a script
?? / ??=Null-coalescing (PowerShell 7+)
?. / ?[ ]Null-conditional access (PowerShell 7+)

⚠️ Comparisons are case-insensitive by default. Use -ceq, -clike, -cmatch when case matters.

🧱 Objects & the Pipeline

# properties and methods
(Get-Date).Date
(Get-Date).AddDays(-7)
"string".ToUpper()

# static members
[DateTime]::Now
[Math]::Round(3.14159, 2)
[System.Net.Dns]::GetHostByAddress("127.0.0.1")

# build your own objects
[pscustomobject]@{ Name = 'web01'; Status = 'up' }

# add a calculated property
Get-Process | Select-Object Name, @{ Name = 'MB'; Expression = { [math]::Round($_.WorkingSet / 1MB, 1) } }

🔍 Filter, Sort, Group, Format

ExampleDoes
Get-Process | Where-Object CPU -gt 100Filter (simple syntax)
Get-Process | Where-Object { $_.Name -like "chrome*" }Filter (script block)
Get-Process | Sort-Object WorkingSet -DescendingSort
Get-Process | Select-Object -First 5Take the first few
"a","b","a" | Select-Object -UniqueDeduplicate
Get-Service | Group-Object StatusGroup
Get-Process | Measure-Object WorkingSet -Sum -AverageAggregate
Get-Process | Select-Object -ExpandProperty ModulesFlatten a nested property
Get-Process | Format-Table Name, Id -AutoSizeTable output
Get-Item C:\ | Format-List *Every property
Get-Content log.txt | Select-String "error"grep
Compare-Object $a $bDiff two collections

💡 Format-* is always the last step — its output is display text, not objects, so nothing downstream can filter it.

🧰 Functions & Scripts

function Get-Square {
  param(
    [Parameter(Mandatory)][int]$Number,
    [switch]$Verbose
  )
  $Number * $Number
}

Get-Square -Number 7

# an advanced function: pipeline input, -WhatIf, -Verbose for free
function Remove-OldLog {
  [CmdletBinding(SupportsShouldProcess)]
  param(
    [Parameter(ValueFromPipeline)][string]$Path,
    [int]$Days = 30
  )
  process {
    if ($PSCmdlet.ShouldProcess($Path, "delete")) {
      Remove-Item $Path
    }
  }
}

🚨 Error Handling

try {
  Get-Content missing.txt -ErrorAction Stop
}
catch [System.IO.FileNotFoundException] {
  Write-Warning "no such file"
}
catch {
  Write-Error "unexpected: $($_.Exception.Message)"
}
finally {
  "always runs"
}

# make non-terminating errors terminate, so catch can see them
Get-Item missing -ErrorAction Stop

# per-session default
$ErrorActionPreference = 'Stop'

# the most recent error, and the exit code of the last native command
$Error[0]
$LASTEXITCODE
$?

🌐 Web & Data

# REST calls, parsed into objects
$data = Invoke-RestMethod https://api.github.com/repos/vuejs/core
$data.stargazers_count

# with headers and a JSON body
Invoke-RestMethod -Uri $url -Method Post `
  -Headers @{ Authorization = "Bearer $token" } `
  -ContentType 'application/json' `
  -Body (@{ name = 'demo' } | ConvertTo-Json)

# the raw response, for scraping or downloads
Invoke-WebRequest $url -OutFile page.html

# convert between formats
Get-Process | Select-Object Name, Id | ConvertTo-Json
Get-Content data.json | ConvertFrom-Json
Import-Csv users.csv | Where-Object Dept -eq 'IT' | Export-Csv it.csv -NoTypeInformation
Export-Clixml / Import-Clixml   # round-trips real objects

🖥 System Administration

# processes
Get-Process | Sort-Object CPU -Descending | Select-Object -First 10
Stop-Process -Name notepad -Force

# services
Get-Service | Where-Object Status -eq 'Running'
Restart-Service -Name Spooler
Set-Service -Name Spooler -StartupType Manual

# background jobs
$job = Start-Job { Start-Sleep 10; "done" }
Receive-Job $job -Wait

# scheduled tasks, event logs, system info
Get-ScheduledTask
Get-WinEvent -LogName System -MaxEvents 20
Get-CimInstance Win32_LogicalDisk | Select-Object DeviceID, FreeSpace
Test-Connection example.com -Count 2

🔗 Remoting

# one command on many machines
Invoke-Command -ComputerName web01, web02 -ScriptBlock { Get-Service Spooler }

# an interactive session
Enter-PSSession -ComputerName web01
Exit-PSSession

# a reusable session
$s = New-PSSession -ComputerName web01 -Credential (Get-Credential)
Invoke-Command -Session $s { hostname }
Remove-PSSession $s

📦 Modules & Execution Policy

# find, install, load
Find-Module Pester
Install-Module Pester -Scope CurrentUser
Import-Module Pester
Get-Module -ListAvailable

# where does PowerShell look for modules?
$env:PSModulePath -split [IO.Path]::PathSeparator

# scripts refuse to run? check and relax the policy
Get-ExecutionPolicy -List
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

# your profile script
notepad $PROFILE

🧾 Automatic Variables

VariableHolds
$_ / $PSItemThe current pipeline object
$ArgsUnbound arguments to a script or function
$ErrorThe error history, newest first
$MatchesCapture groups from the last -match
$PSVersionTableVersion and edition information
$PWD / $HOMECurrent directory / home directory
$PSScriptRootThe folder the running script lives in
$LASTEXITCODEExit code of the last native command
$?Did the last command succeed?
$true $false $nullConstants
$PROFILEPath to your profile script

💾 PSDrives

DriveContents
Env:Environment variables
Alias:Command aliases
Function:Defined functions
Variable:Variables
Cert:Certificate stores
HKLM: / HKCU:The registry
WSMan:WinRM configuration
Set-Location HKLM:\SOFTWARE
Get-ChildItem Env: | Sort-Object Name
Get-ChildItem Variable:

⌨️ Aliases Worth Knowing

AliasReal commandAliasReal command
ls, dir, gciGet-ChildItem%ForEach-Object
cat, gcGet-Content?Where-Object
cd, slSet-LocationselectSelect-Object
cp, copyCopy-ItemsortSort-Object
rm, delRemove-Itemft / flFormat-Table / Format-List
ps, gpsGet-ProcessslsSelect-String
killStop-ProcessgmGet-Member

⚠️ Aliases are for the console, not for scripts — write the full cmdlet name in anything you commit.

🔣 Regular Expressions

PatternMatches
\w / \WWord character / non-word
\s / \SWhitespace / non-whitespace
\d / \DDigit / non-digit
{n} {n,} {n,m}Quantifiers
^ / $Start / end of the string
(?<name>…)Named capture group
# -match fills $Matches
if ("build-1234" -match '(?<name>\w+)-(?<id>\d+)') { $Matches.id }

# extract every match from a file
Select-String -Path app.log -Pattern '\b\d{1,3}(\.\d{1,3}){3}\b' -AllMatches |
  ForEach-Object { $_.Matches.Value } | Sort-Object -Unique

PowerShell uses the .NET regex engine — see .NET regular expressions.

📚 Resources

  • PowerShell documentation
  • Cmdlet reference
  • PowerShell Gallery
  • Style guide (community)