go to latexindent.pl and download latexindent.exe, defaultSettings.yaml, add-to-path.bat to the directory where you want to have latexindent.
right click on add-to-path.bat and click Run as administrator.
log out and lock back in
open a command prompt type the following and hit enter
echo %path%
to check if latexindent is now in your PATH
Linux
go to latexindent.pl and download latexindent.pl, defaultSettings.yaml the directory where you want to have latexindent.
within your directory create a directory called path-helper-files and download CMakeLists.txt and cmake_uninstall.cmake.in from the folder path-helper-files to this directory