'platformio' is not recognized as an internal or external command

Please use PlatformIO IDE which has built-in PIO Core.

If you need PlatformIO Core CLI globally, see Redirecting...