Skip to content

Commit 62efcb7

Browse files
author
0xfab1
committed
2 parents 94c3fcf + b6b58ad commit 62efcb7

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/tech/dev/powershell/index.md

+18
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,24 @@ $keyword = @{"de-DE" = 'Schlüsselinhalt'; "en-US" = 'Key Content'}
8080
Invoke-Expression -Command '(netsh wlan show profiles) | Select-String "\:(.+)$" | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name="$name" key=clear)} | Select-String ($keyword[(get-culture).Name]+"\W+\:(.+)$") | %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ WiFi=$name;PASSWORD=$pass }} | Format-Table -AutoSize'
8181
```
8282

83+
CPU Temperature
84+
85+
``` ps1
86+
Get-WmiObject -Query "SELECT * FROM Win32_PerfFormattedData_Counters_ThermalZoneInformation" | Select-Object Name, @{Name='TemperatureInCelsius';Expression={$_.Temperature / 10}}
87+
```
88+
89+
Run this to log the CPU Temp over time:
90+
91+
``` ps1
92+
while ($true) {
93+
$date = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
94+
$tempInfo = Get-WmiObject -Query "SELECT * FROM Win32_PerfFormattedData_Counters_ThermalZoneInformation" |
95+
Select-Object @{Name='Timestamp';Expression={$date}}, Name, @{Name='TemperatureInCelsius';Expression={"{0:N2}" -f ($_.Temperature / 10)}}
96+
$tempInfo | Out-String | Out-File -FilePath "TemperatureLog.txt" -Append
97+
Start-Sleep -Seconds 5
98+
}
99+
```
100+
83101
WinSAT information
84102

85103
``` ps1

0 commit comments

Comments
 (0)