SilverTech Posted March 7, 2007 Report Share Posted March 7, 2007 Hi there! Im on a litle project and need some help. How do i transform values like network speed that are in Bytes in Kbytes My commandline so far looks like this: Get-WmiObject Win32_PerfFormattedData_PerfNet_Redirector | out-gauge -value BytesTotalPersec -float -refresh 0:0:1 -type digitalĀ Quote Link to comment Share on other sites More sharing options...
marco.shaw Posted March 7, 2007 Report Share Posted March 7, 2007 You can do this with a scriptblock: Get-WmiObject Win32_PerfFormattedData_PerfNet_Redirector | out-gauge -value {$_.BytesTotalPersec/1000} -float -refresh 0:0:1 -type digital Quote Link to comment Share on other sites More sharing options...
SilverTech Posted March 7, 2007 Author Report Share Posted March 7, 2007 thx m8. It worked perfectly if anyone else is reading this i also used -ValueFormat "##.00" and devided the value with 1024/1024 to get it in MB Quote Link to comment Share on other sites More sharing options...
marco.shaw Posted March 8, 2007 Report Share Posted March 8, 2007 Oh, and instead of doing "/1024/1024", you can just do "/1mb" with PowerShell. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.