The term 'terraform' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a p
Above error comes usually in case of not having terraform extension in Visual Studio Code or not having environment variable set for terraforms.
To fix this issue, just search HashiCorp Terraform under extensions.
If you have installed the terraform. Make sure you add the path to the environment variable. Type in search >> Env > Environment Variables >> System Variables >> Select Path and edit. Add the path to your Terraform application which you have downloaded. Reboot the system. That's it. try again
after setting the environment variable this issue gets fixed.