Це стара версія документу!
By default Windows 10 and 11 comes with PS 5.1. You can get more modern PowerShell with winget:
winget install --id Microsoft.Powershell --source winget
that's all.
You can check which versions are available with
winget search Microsoft.PowerShell
New PowerShell will be installed additionally to existing PS. In Terminal after restart you will find new profile:
You can always find which PS version you run by running
get-host
Check who uses CPU:
Get-Process | Sort-Object -Descending CPU | Select-Object -First 20
Check who uses memory:
Get-Process | Sort-Object WorkingSet64 -Descending |
Select-Object Name, @{Name='Memory (MB)';Expression={[math]::Round($_.WorkingSet64/1MB,2)}} |
Select-Object -First 15
Quick memory overview (data in kilobytes):
Get-WmiObject Win32_OperatingSystem | Select-Object TotalVisibleMemorySize, FreePhysicalMemory
Calculate free memory percentage:
$os = Get-WmiObject Win32_OperatingSystem $pctFree = [math]::Round(($os.FreePhysicalMemory / $os.TotalVisibleMemorySize) * 100, 2) Write-Host "Memory Utilization: $pctFree% Free"
Get 50 last messages from system EventLog:
Get-EventLog -LogName System -EntryType Error, Warning -Newest 50