* Parse the output of getmac.exe to get the list of MAC addresses for the PC.
()
| 39 | * Parse the output of getmac.exe to get the list of MAC addresses for the PC. |
| 40 | */ |
| 41 | async function getMacAddresses(): Promise<string[]> { |
| 42 | try { |
| 43 | const output = await execChildProcess('getmac'); |
| 44 | const regex = /(?:[a-z0-9]{2}[:\-]){5}[a-z0-9]{2}/gmi; |
| 45 | return output.match(regex) ?? []; |
| 46 | } catch { |
| 47 | return []; |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * Code below is adapted from: |
no test coverage detected