Error when trying to install external library

I’m trying to install a library not found in the search function.

E:\Documents\PlatformIO\Projects\ATtiny_temp> pio lib install C:\users\hans\downloaeds\avr-onewire.zip
pio: The term 'pio' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
PS E:\Documents\PlatformIO\Projects\ATtiny_temp> pio lib install "C:\users\hans\downloaeds\avr-onewire.zip"
pio: The term 'pio' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
PS E:\Documents\PlatformIO\Projects\ATtiny_temp>

By default the PlatformIO installation is only visible within the CLI of VSCode.

To make the shell commands visible globally, see docs.

Also, instead of executing that, one can rather do

lib_deps = 
   AVR-OneWire=file://C:\users\hans\downloaeds\avr-onewire.zip

in the platformio.ini. It understands the file:// protocol, too.

I went into PlatformIO Core CLI and put in the command again and it worked. The library was installed but PlatformIO.ini was not updated. Shouldn’t it be updated when a library is installed?

It does it for me when I run the commands.

>type platformio.ini
[env:uno]
platform = atmelavr
board = uno
framework = arduino

>pio lib install C:\Users\Max\Documents\PlatformIO\test_lib
Library Storage: C:\Users\Max\Documents\PlatformIO\Projects\lib_test\.pio\libdeps\uno
Library Manager: Installing file://C:\Users\Max\Documents\PlatformIO\test_lib
Library Manager: test_lib @ 0.0.0+20210302204959 has been installed!

>type platformio.ini
[env:uno]
platform = atmelavr
board = uno
framework = arduino
lib_deps = C:\Users\Max\Documents\PlatformIO\test_lib

So make sure to be at the latest core version with pio upgrade --dev.

I upgraded now to 5.1.1a3 and it works now. Strange that I have to upgrade. I installed VSCode and Platformio on Wednesday. Anyway, all well now.