Тут показані розбіжності між вибраною ревізією та поточною версією сторінки.
| Наступна ревізія | Попередня ревізія | ||
|
software:os:windows:powershell [2023/09/09 02:38] charon створено |
software:os:windows:powershell [2025/12/30 13:13] (поточний) charon |
||
|---|---|---|---|
| Рядок 6: | Рядок 6: | ||
| You can check which versions are available with | You can check which versions are available with | ||
| winget search Microsoft.PowerShell | winget search Microsoft.PowerShell | ||
| + | | ||
| + | ===== How to run new PowerShell ===== | ||
| + | New PowerShell will be installed additionally to existing PS. In Terminal after restart you will find new profile: | ||
| + | * Windows PowerShell - old profile, PS 5.1 | ||
| + | * PowerShell - new profile, PS 7.* | ||
| + | |||
| + | ===== How to find PowerShell version ===== | ||
| + | You can always find which PS version you run by running | ||
| + | get-host | ||
| + | | ||
| + | ===== How to analyze system performance with PowerShell ===== | ||
| + | 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=' | ||
| + | Select-Object -First 15 | ||
| + | Quick memory overview (data in kilobytes): | ||
| + | Get-WmiObject Win32_OperatingSystem | Select-Object TotalVisibleMemorySize, | ||
| + | Calculate free memory percentage: | ||
| + | $os = Get-WmiObject Win32_OperatingSystem | ||
| + | $pctFree = [math]:: | ||
| + | Write-Host " | ||
| + | Get 50 last messages from system EventLog: | ||
| + | Get-EventLog -LogName System -EntryType Error, Warning -Newest 50 | ||
| + | Show uptime (old Windows versions): | ||
| + | (New-TimeSpan -Start (Get-CimInstance Win32_OperatingSystem).LastBootUpTime -End (Get-Date)) | ||
| + | |||
| + | ===== Working with files and folders ===== | ||
| + | [[software: | ||