Last active
January 24, 2022 16:17
-
-
Save csev1755/3b00bac0b0fc158b3eadc50ab867c2db to your computer and use it in GitHub Desktop.
Get Windows 10 license key and output info to a file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$servicetag = Read-Host "Enter Service Tag" | |
$filename = "$servicetag-KEY.txt" | |
Get-Date | Out-File -FilePath $filename -append | |
(Get-WmiObject -class Win32_OperatingSystem).Caption | Out-File -FilePath $filename -append | |
wmic path SoftwareLicensingService get OA3xOriginalProductKey | Out-File -FilePath $filename -append |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment