Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $wmicOutput = ((wmic path softwarelicensingservice get OA3xOriginalProductKey) | Out-String).Replace("`n", "");
- $regexMatch = [regex]::Match($wmicOutput, "(?<orgKey>[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+)");
- if ($regexMatch.Success)
- {
- echo "Found Key from UEFI BIOS";
- $key = $regexMatch.Groups["orgKey"];
- Set-Clipboard $key;
- echo "$key; Copied to Clipboard.";
- } else {
- echo "No key found.";
- }
- pause;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement