Since it was still using an old version of the pnp powershell module….I’ve brought up to speed with the current pnp module. The functions and options of this solutions are described in the original 2019 blogpost.

Find the source here:
https://github.com/jflieben/assortedFunctionsV2/blob/main/fix-filesWithLongPathsInOffice365.ps1
[…] Update to Long Path Fix tool for Onedrive and Sharepoint […]