You will need to update the CompanyName to yours
#Change AutoSaveLocation to OneDrive
$onedrivelocation = %userprofile%\OneDrive - **CompanyName**\
mkdir "$onedrivelocation\Autorecover\Word\"
New-ItemProperty -path "HKCU:\Software\Microsoft\Office\16.0\Word\Options" -Name AUTOSAVE-PATH -PropertyType "ExpandString" -Value "$onedrivelocation\Autorecover\Word\"
mkdir "$onedrivelocation\Autorecover\Excel\"
New-ItemProperty -path "HKCU:\Software\Microsoft\Office\16.0\excel\Options" -Name AutoRecoverPath -PropertyType "ExpandString" -Value "$onedrivelocation\Autorecover\Excel\"
mkdir "$onedrivelocation\Autorecover\Powerpoint\"
New-ItemProperty -path "HKCU:\Software\Microsoft\Office\16.0\PowerPoint\Options" -Name PathToAutoRecoveryInfo -PropertyType "ExpandString" -Value "$onedrivelocation\Autorecover\Powerpoint\"