Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- InstanceName value
- ------------ -----
- intel[r] i350 gigabit network connection 11.85
- Function Start-Monitoring
- {
- $Username = 'domainuser'
- $Password = 'password'
- $pass = ConvertTo-SecureString -AsPlainText $Password -Force
- $SecureString = $pass
- # Uses your password securely
- $MySecureCreds = New-Object -TypeName
- System.Management.Automation.PSCredential -ArgumentList $Username, $SecureString
- While ($true)
- {
- # Do things lots
- Invoke-command {Get-Counter -Counter "Network Interface(intel[r] i350 gigabit network connection)Bytes Received/sec" -sampleinterval 6 |select -exp countersamples|ft -a instancename,@{l="value";e={[math]::round($_.cookedvalue/.1MB,2)}}} -Credential $MySecureCreds -Verbose -ComputerName ipaddress
- # Add a pause so the loop doesn't run super fast and use lots of CPU
- Start-Sleep 10
- }
- }
- Start-Monitoring
- #BandTextBox
- #
- $BandTextBox.Location = '175, 75'
- $BandTextBox.Name = 'BandTextBox'
- $BandTextBox.Size = '40, 20'
- $BandTextBox.TabIndex = 4
- $BandTextBox.Text = ''
- #
Add Comment
Please, Sign In to add comment