forked from tomtorggler/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGet-TeamsNetAssessmentStats.ps1
51 lines (43 loc) · 1.6 KB
/
Get-TeamsNetAssessmentStats.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
function Get-Jitter {
[CmdletBinding()]
param (
$Filename
)
process {
(Select-String -Path $Filename -Pattern "jitter:\s+(\d+\.\d+)\sms").matches.groups.where{$_.name -eq 1}.value | Measure-Object -Minimum -Maximum -Average
}
}
function Get-PLoss {
[CmdletBinding()]
param (
$Filename
)
process {
(Select-String -Path $Filename -Pattern "loss\srate:\s+(\d+\.\d+)").matches.groups.where{$_.name -eq 1}.value | ForEach-Object {[double]$_*100} | Measure-Object -Minimum -Maximum -Average
}
}
function Get-Latency {
[CmdletBinding()]
param (
$Filename
)
process {
(Select-String -Path $Filename -Pattern "latency:\s+(\d+(\.\d+)?)").matches.groups.where{$_.name -eq 1}.value | Measure-Object -Minimum -Maximum -Average
}
}
function Get-TeamsNetAssessmentStats {
[CmdletBinding()]
param (
$Filename
)
process {
Write-Information "Packet Loss" -InformationAction Continue
Get-PLoss -Filename $Filename
Write-Information "Jitter" -InformationAction Continue
Get-Jitter -Filename $Filename
Write-Information "Latency" -InformationAction Continue
Get-Latency -Filename $Filename
}
}
#Get-TeamsNetAssessmentStats -Filename "C:\Users\thomas.torggler\Experts Inside GmbH\DT Swiss - Netzwerk Assessment\Biel - LAN\TeamsSkypeStatsDetail.txt"
Get-TeamsNetAssessmentStats -Filename "C:\Users\thomas.torggler\Experts Inside GmbH\unisg - Network Assessment\StGallen - WIFI\TeamsSkypeStatsDetail.txt"