جميع الأدوات
مجاني

مرجع PowerShell قابل للبحث والطباعة — الأوامر، خط الأنابيب، المتغيرات، الملفات، الحلقات، الدوال، الكائنات والإدارة. مجانًا.

Getting help & discovery

12
Get-Help Get-Process
Show help for a cmdlet
Get-Help Get-Process -Examples
Show usage examples for a cmdlet
Get-Help Get-Process -Full
Show the full help including parameters
Get-Help about_Functions
Read a conceptual about_ topic
Update-Help
Download the latest help files
Get-Command -Noun Process
List cmdlets that act on a noun
Get-Command -Verb Get
List cmdlets using a given verb
Get-Command *service*
Search commands by wildcard name
Get-Process | Get-Member
List the properties and methods of objects
Get-Alias ls
Show what command an alias resolves to
Get-Alias -Definition Get-ChildItem
List all aliases for a cmdlet
$PSVersionTable
Show the PowerShell version and edition

Variables & types

13
$x = 5
Assign a value to a variable
[int]$n = '42'
Declare a strongly typed variable
$null
The null / empty value
$true; $false
Boolean literals
$arr = @(1, 2, 3)
Create an array
$arr += 4
Append an element to an array
$arr[0]; $arr[-1]
Index first and last array elements
$hash = @{ Name = 'Ann'; Age = 30 }
Create a hashtable
$hash['Name']; $hash.Name
Read a hashtable value by key
$env:PATH
Read an environment variable
$env:MY_VAR = 'value'
Set an environment variable for the session
Get-Variable
List all defined variables
[math]::Round(3.14159, 2)
Call a static .NET method

Pipeline & filtering

12
Get-Process | Where-Object { $_.CPU -gt 10 }
Filter objects by a condition
Get-Process | ? CPU -gt 10
Filter with the ? alias and simplified syntax
Get-Process | ForEach-Object { $_.Name }
Run a script block for each object
Get-Process | % { $_.Kill() }
Iterate with the % alias
Get-Process | Select-Object Name, Id
Keep only specific properties
Get-Process | Select-Object -First 5
Take the first N objects
Get-Process | Sort-Object CPU -Descending
Sort objects by a property
Get-Process | Group-Object Company
Group objects by a property
Get-Process | Measure-Object CPU -Sum
Aggregate numeric values (sum, average)
Get-ChildItem | Select-Object -Unique
Return distinct objects
1..5 | ForEach-Object { $_ * 2 }
Pipe a range through a transform
Get-Process | Out-GridView
Send results to an interactive grid

Files & paths

13
Get-ChildItem -Path C:\Logs
List items in a directory (alias ls/dir)
Get-ChildItem -Recurse -Filter *.log
List matching files recursively
Get-Content .\file.txt
Read a file line by line
Get-Content .\file.txt -Tail 20
Read the last N lines of a file
Set-Content .\file.txt -Value 'Hi'
Write (overwrite) text to a file
Add-Content .\file.txt -Value 'Hi'
Append text to a file
Copy-Item a.txt b.txt
Copy a file or directory
Move-Item a.txt .\dir\
Move or rename an item
Remove-Item a.txt -Force
Delete a file or directory
New-Item -ItemType Directory -Path .\dir
Create a new file or directory
Test-Path .\file.txt
Check whether a path exists
Get-Location
Show the current directory (alias pwd)
Set-Location C:\Temp
Change the current directory (alias cd)

Strings & text

12
'Hello World' -match 'World'
Test a string against a regex
'Hello' -replace 'l', 'L'
Replace text using a regex
'a,b,c' -split ','
Split a string into an array by regex
'a-b-c'.Split('-')
Split using the .NET String method
'a', 'b' -join ', '
Join array elements into a string
Select-String -Path *.log -Pattern 'error'
Grep-style search across files
'{0} of {1}' -f 3, 10
Format a string with placeholders
' hi '.Trim()
Strip leading and trailing whitespace
'Hello'.ToUpper()
Convert a string to uppercase
'Hello'.Substring(0, 3)
Extract a substring by index and length
'Hello'.Contains('ell')
Test whether a string contains text
'Hello'.Length
Get the number of characters

Loops & conditionals

12
if ($x -gt 0) { 'pos' } elseif ($x -eq 0) { 'zero' } else { 'neg' }
Branch with if / elseif / else
switch ($x) { 1 { 'one' } default { 'other' } }
Match a value against cases
foreach ($i in $arr) { $i }
Iterate over a collection
for ($i = 0; $i -lt 5; $i++) { $i }
Counted loop with an index
while ($x -lt 10) { $x++ }
Loop while a condition is true
do { $x++ } while ($x -lt 10)
Loop at least once, then test
$x -eq 5; $x -ne 5
Equal and not-equal comparisons
$x -gt 5; $x -lt 5
Greater-than and less-than comparisons
$x -ge 5; $x -le 5
Greater/less-than-or-equal comparisons
'abc' -like 'a*'
Wildcard match comparison
@(1, 2, 3) -contains 2
Test array membership
break; continue
Exit or skip the current loop iteration

Functions & scripts

12
function Get-Sum { param($a, $b) $a + $b }
Define a function with parameters
Get-Sum -a 2 -b 3
Call a function with named arguments
function Test { param([int]$n = 1) }
Typed parameter with a default value
param([Parameter(Mandatory)]$Name)
Require a parameter to be supplied
return $value
Return a value from a function
function F { [CmdletBinding()] param() }
Make an advanced function (common params)
Write-Verbose 'msg' -Verbose
Emit a verbose message stream
Write-Output $result
Send an object to the pipeline
Write-Error 'failed'
Write to the error stream
.\script.ps1 -Arg value
Run a script file with arguments
. .\functions.ps1
Dot-source a script into the session
try { } catch { $_ } finally { }
Handle terminating errors

Objects & properties

12
Get-Process | Select-Object -ExpandProperty Name
Return raw property values, not objects
(Get-Process).Name
Access a property on each object
Get-Process | Select-Object Name, @{ Name = 'MB'; Expression = { $_.WS / 1MB } }
Add a calculated property
[PSCustomObject]@{ Name = 'Ann'; Age = 30 }
Build a custom object
$obj | Add-Member -NotePropertyName Tag -NotePropertyValue 'x'
Attach a property to an object
$obj.PSObject.Properties.Name
List an object's property names
$obj | Format-Table -AutoSize
Display objects as an aligned table
$obj | Format-List *
Display all properties as a list
$obj | ConvertTo-Json -Depth 5
Serialize an object to JSON
Get-Content data.json | ConvertFrom-Json
Parse JSON into objects
$obj | Export-Csv out.csv -NoTypeInformation
Export objects to a CSV file
Import-Csv data.csv
Read a CSV file into objects

Processes & services

12
Get-Process
List running processes (alias ps)
Get-Process -Name chrome
Get processes by name
Stop-Process -Name notepad -Force
Terminate a process
Start-Process notepad.exe
Launch a new process
Get-Service
List Windows services
Get-Service -Name wuauserv
Get a service by name
Start-Service -Name wuauserv
Start a stopped service
Stop-Service -Name wuauserv
Stop a running service
Restart-Service -Name wuauserv
Restart a service
Set-Service -Name wuauserv -StartupType Manual
Change a service start mode
Get-EventLog -LogName System -Newest 20
Read recent classic event-log entries
Get-WinEvent -LogName Application -MaxEvents 20
Query modern event logs

Remoting & jobs

12
Enter-PSSession -ComputerName Srv01
Start an interactive remote session
Exit-PSSession
Leave an interactive remote session
Invoke-Command -ComputerName Srv01 -ScriptBlock { Get-Service }
Run a command on a remote host
$s = New-PSSession -ComputerName Srv01
Create a persistent remote session
Invoke-Command -Session $s -ScriptBlock { hostname }
Reuse an existing remote session
Remove-PSSession $s
Close and remove a remote session
Start-Job -ScriptBlock { Get-Process }
Run a command as a background job
Get-Job
List background jobs and their state
Receive-Job -Id 1 -Keep
Retrieve the output of a job
Wait-Job -Id 1
Block until a job completes
Stop-Job -Id 1; Remove-Job -Id 1
Stop and remove a background job
Get-Process | Start-ThreadJob { $input }
Run lightweight in-process thread jobs

Modules & packages

12
Get-Module
List currently loaded modules
Get-Module -ListAvailable
List all installed modules
Import-Module Pester
Load a module into the session
Remove-Module Pester
Unload a module from the session
Find-Module -Name PSReadLine
Search the gallery for a module
Install-Module PSReadLine -Scope CurrentUser
Install a module from the gallery
Update-Module PSReadLine
Update an installed module
Uninstall-Module PSReadLine
Remove an installed module
Get-ExecutionPolicy
Show the current script execution policy
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Allow signed and local scripts to run
Get-PSRepository
List configured package repositories
$PROFILE
Path to the current user profile script

لا يوجد إدخال يطابق “:q”.


حول ورقة PowerShell المرجعية

يغطي دليل PowerShell هذا الصدفة من الاستكشاف إلى الأتمتة: الحصول على المساعدة والاستكشاف، المتغيرات والأنواع، الأنبوب (pipeline) والتصفية، الملفات والمسارات، النصوص، الحلقات والشروط، الدوال والسكربتات، الكائنات والخصائص، العمليات والخدمات، التحكم عن بُعد والمهام، والوحدات والحزم.

يختلف PowerShell عن صدفات POSIX لأن الأنبوب ينقل كائنات لا نصوصًا — لذا يعتمد الدليل على أوامر الاستكشاف وأنماط تصفية الكائنات التي تجعل هذا النموذج مفهومًا، إلى جانب أوامر الملفات والنصوص والعمليات التي يستخدمها المسؤولون يوميًا.

الدليل مجاني ويعمل من جانب المتصفح. صفّ الأوامر مباشرة بمربع البحث، انتقل بين الأقسام من جدول المحتويات الثابت، انسخ أي أمر بنقرة واحدة واطبع الصفحة كمرجع بجانب الطرفية.

كيفية استخدام ورقة PowerShell المرجعية

  1. ابدأ بقسم الحصول على المساعدة والاستكشاف — فأوامره تتيح لك استكشاف كل شيء آخر.
  2. ابحث عن فعل أو اسم مثل Get- أو service أو foreach لتصفية الدليل مباشرة.
  3. انتقل إلى قسم مثل الأنبوب والتصفية أو التحكم عن بُعد والمهام عبر الشريط الجانبي الثابت.
  4. انقر على أمر أو أيقونة نسخه لنسخه إلى جلسة PowerShell الخاصة بك.
  5. اطبع الدليل للحصول على مرجع أوامر يعمل دون اتصال.

الأسئلة الشائعة

أحد عشر قسمًا: المساعدة والاستكشاف، المتغيرات والأنواع، الأنبوب والتصفية، الملفات والمسارات، النصوص، الحلقات والشروط، الدوال والسكربتات، الكائنات والخصائص، العمليات والخدمات، التحكم عن بُعد والمهام، والوحدات والحزم.

ينقل PowerShell كائنات منظمة بدلًا من النصوص، لذا تصفّي على الخصائص بدلًا من تحليل النصوص. توضح أقسام الأنبوب والكائنات في الدليل هذه الأنماط جنبًا إلى جنب مع الأوامر اليومية.

نعم. يسرد قسم التحكم عن بُعد والمهام الأوامر لتشغيل العمل على أجهزة بعيدة وفي مهام خلفية، بجانب قسم العمليات والخدمات للإدارة المحلية.

نعم. انقر على أي أمر أو أيقونة نسخه عند التحويم فيوضع في الحافظة للصقه في وحدة التحكم.

نعم، مجاني وقابل للبحث والطباعة ولا يتطلب حسابًا.

شارك هذا

عمليات البحث الشائعة
powershell cheat sheet قائمة أوامر powershell مرجع powershell cmdlets تصفية pipeline في powershell المتغيرات والأنواع في powershell مثال سكربت powershell أوامر powershell remoting مرجع modules في powershell
هل تحتاج إلى مساعدة؟
هل واجهت مشكلة في هذه الأداة؟ أخبر فريقنا.
الإبلاغ عن مشكلة

أضف هذه الأداة المجانية إلى موقعك الخاص — انسخ والصق الكود أدناه.