see windows 10 product key code example
Example 1: how to get current product key windows 10
wmic path softwarelicensingservice get OA3xOriginalProductKey
Example 2: how to view product key in windows 10
wmic path SoftwareLicensingService get OAxOriginalProductKey
write this in Powershell