I have made a powershell script, which does some add/delete things locally on a client with MS onedrive problems. Please see the script attached.
I succesfull tested the script on my own client and that fine, but now i found out that the local sync location path is different and uses different locations and pathnames on all company clients and therefore i need to add some code to my script which does the following:
- Read the following stringdata regkey
Data: C:\Users\dfbdp\OneDrive - Danske Fragtmænd A-S
- Insert this datavalue (path of folder) into the "Move-Item “C:\Users$env:username\OneDrive - Danske Fragtmænd A-S” “C:\Users$env:username\Desktop\Onedrive_Backup”…
in the script so i basicly read the location path from the regdatabase instead.
I have tried to solve this problem my selv with the Get-RegistryKey etc but have not been able to make it work.
I am not that skilled in this, so can anyone help me?