MCPcopy Index your code
hub / github.com/microsoft/vscode-cpptools / getMacAddresses

Function getMacAddresses

Extension/src/id.ts:41–49  ·  view source on GitHub ↗

* Parse the output of getmac.exe to get the list of MAC addresses for the PC.

()

Source from the content-addressed store, hash-verified

39 * Parse the output of getmac.exe to get the list of MAC addresses for the PC.
40 */
41async 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:

Callers 1

logMachineIdMappingsFunction · 0.85

Calls 1

execChildProcessFunction · 0.90

Tested by

no test coverage detected