Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

Optimize command

$
0
0

Hi i'm pretty new to Powershell and need some help if there are a more optimal way to make this code:

gwmi -Namespace root\hpq -Class HP_NumericSensor | ? {$_.Name -eq "Temperature Sensor 1"} | % {@{($_.Name -replace "Temperature Sensor 1", "Room Temperature")=$($_.CurrentReading)}}


Viewing all articles
Browse latest Browse all 2562

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>