Користувальницькькі налаштування

Налаштування сайту


software:os:windows:powershell

Розбіжності

Тут показані розбіжності між вибраною ревізією та поточною версією сторінки.

Посилання на цей список змін

Наступна ревізія
Попередня ревізія
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='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
 +Show uptime (old Windows versions):
 +  (New-TimeSpan -Start (Get-CimInstance Win32_OperatingSystem).LastBootUpTime -End (Get-Date))
 +
 +===== Working with files and folders =====  
 +[[software:os:windows:powershell:files|How to work with files and folders]]
software/os/windows/powershell.1694216290.txt.gz · Востаннє змінено: 2023/09/09 02:38 повз charon