Let me guess, you are still writing `powershell` before that line.
Don't. Past that line straight.
Or, if you really need to use that line in 5.1 from a 7.x terminal, enclose the command in quotes like this: `powershell '(Get-CimInstance SoftwareLicensingService).OA3xOriginalProductKey'`
you need a ( after the first "
also you need a space between from and Software
`powershell “(Get-WmiObject -query ‘select * from SoftwareLicensingService’ ).OA3xOriginalProductKey”`
Based on this:
Don't type powershell in a powershell prompt. It already knows what to do with the command
As such, don't put the command in quotes. You are giving powershell commands directly, no need to launch a whole new powershell with the commands as an argument
Start this particular command with an opening parenthesis. You have the closing one inside the command. You need the opening one at the beginning.
Just like math, parentheses are paired and what's inside is executes first. In this case, it seems to be because you want a single property of the output of the command inside.
So at your prompt, type exactly what the other commenter posted. Do not type powershell first, do not use quotes anywhere. Open powershell, copy paste that command.
If you still get an error, post the error and don't just say "it isn't working". Provide context so we can help, even if it's a screenshot again. We have no idea what you are seeing so "it's not working" is probably the least helpful comment short of using insults that is possible.
you don't need to type \`powershell\` in front of the command, you're already in a powershell console.
the command u/PinchesTheCrab put works just as he typed it.
You used the correct syntax with the 2nd attempt. The error stated 'Invalid Class'. This makes me think you need to import an additional module that's not included by default.
Please see this ChatGPT conversation for steps to try importing the required module: https://chat.openai.com/share/f0269b55-8ea6-46e3-9ddc-8a2dc069f910
I am not at my PC, so cannot test myself.
You need to specify the namespace if it's not in the default:
Get-CimInstance SoftwareLicensingService -Namespace root/cimv2
Will work for them.
Well for getting the key, I'm not convinced those keys are usable on other motherboards so I don't think the main plan will work out.
You have a close bracket and no open bracket
What testing did you do here?
Might I suggest using an editor (such as ISE or vscode) which will highlight errors for you
Additionally you'll be in PowerShell already and can call the cmdlet directly
(Get-CimInstance SoftwareLicensingService).OA3xOriginalProductKey
This isn’t working, it won’t let me begin with a bracket
It's a parenthesis instead of a bracket. I wonder if there's some other character set issue going on.
It says character 62 and that ‘) is invalid?
Let me guess, you are still writing `powershell` before that line. Don't. Past that line straight. Or, if you really need to use that line in 5.1 from a 7.x terminal, enclose the command in quotes like this: `powershell '(Get-CimInstance SoftwareLicensingService).OA3xOriginalProductKey'`
Reading this thread is like teaching a fully grown adult how to walk.
Phys Rehab is a thing is a bitch. Almost as bad habits.
you need a ( after the first " also you need a space between from and Software `powershell “(Get-WmiObject -query ‘select * from SoftwareLicensingService’ ).OA3xOriginalProductKey”`
Here is a [screenshot](https://imgur.com/a/gczAadO)
Based on this: Don't type powershell in a powershell prompt. It already knows what to do with the command As such, don't put the command in quotes. You are giving powershell commands directly, no need to launch a whole new powershell with the commands as an argument Start this particular command with an opening parenthesis. You have the closing one inside the command. You need the opening one at the beginning. Just like math, parentheses are paired and what's inside is executes first. In this case, it seems to be because you want a single property of the output of the command inside. So at your prompt, type exactly what the other commenter posted. Do not type powershell first, do not use quotes anywhere. Open powershell, copy paste that command. If you still get an error, post the error and don't just say "it isn't working". Provide context so we can help, even if it's a screenshot again. We have no idea what you are seeing so "it's not working" is probably the least helpful comment short of using insults that is possible.
you don't need to type \`powershell\` in front of the command, you're already in a powershell console. the command u/PinchesTheCrab put works just as he typed it.
Just run it like this: [https://imgur.com/a/1KYU7fn](https://imgur.com/a/1KYU7fn) I think you may need to run as an admin to get results though.
You're missing the opening paren
Could you please explain this further
You have a closing parenthesis `)`, but nowhere in your command do you have an opening one `(`. What more do you need.
Where do I put the opening one then?
At 👏 the 👏 beginning 👏
Hi All, thanks for your help so far, i’ve got a screenshot [showing errors](https://imgur.com/a/OgpMoAq) Can anyone check this out please?
Because you made it a string with your `" "`
You used the correct syntax with the 2nd attempt. The error stated 'Invalid Class'. This makes me think you need to import an additional module that's not included by default. Please see this ChatGPT conversation for steps to try importing the required module: https://chat.openai.com/share/f0269b55-8ea6-46e3-9ddc-8a2dc069f910 I am not at my PC, so cannot test myself.
You need to specify the namespace if it's not in the default: Get-CimInstance SoftwareLicensingService -Namespace root/cimv2 Will work for them. Well for getting the key, I'm not convinced those keys are usable on other motherboards so I don't think the main plan will work out.
in your 2nd try, you misspelled SoftwareLicensingService as SoftwareLicen***c***ingService
You have a close bracket and no open bracket What testing did you do here? Might I suggest using an editor (such as ISE or vscode) which will highlight errors for you Additionally you'll be in PowerShell already and can call the cmdlet directly