From 12232df6dead34a7d97aae06c409fd269a068a63 Mon Sep 17 00:00:00 2001 From: djamel Date: Thu, 3 Oct 2024 14:47:13 +0200 Subject: [PATCH] Ajouter Create-OUIListFromWeb.ps1 --- Create-OUIListFromWeb.ps1 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Create-OUIListFromWeb.ps1 diff --git a/Create-OUIListFromWeb.ps1 b/Create-OUIListFromWeb.ps1 new file mode 100644 index 0000000..9fa1a6f --- /dev/null +++ b/Create-OUIListFromWeb.ps1 @@ -0,0 +1,15 @@ +#$LatestOUI = Get-Content -Path "$PSScriptRoot\oui_from_web.txt" +$LatestOUIs = (Invoke-WebRequest -Uri "https://standards-oui.ieee.org/oui/oui.txt").Content + +$Output = "" + +foreach($Line in $LatestOUIs -split '[\r\n]') +{ + if($Line -match "^[A-F0-9]{6}") + { + # Line looks like: 2405F5 (base 16) Integrated Device Technology (Malaysia) Sdn. Bhd. + $Output += ($Line -replace '\s+', ' ').Replace(' (base 16) ', '|').Trim() + "`n" + } +} + +Out-File -InputObject $Output -FilePath "$PSScriptRoot\Resources\oui.txt" \ No newline at end of file