Home > Software engineering >  How can I check status of files/folders in OneDrive folder whether it is synced or not using c# or P
How can I check status of files/folders in OneDrive folder whether it is synced or not using c# or P

Time:04-12

I want to check the status (Available when online/ Available on this device) of files residing in OneDrive folder either using C# or PowerShell. I want to check whether file is available on disk, basically check the sync status of files or folder.

enter image description here

Is there any possible way to get this status?

CodePudding user response:

This answer or other answers may be able to help achieve your goal (Sorry if this isn't a real answer, I am unable to comment on posts yet...).

CodePudding user response:

Some installations have problems when trying to use the byPath parameter.

You may test if your installations are affected and if the beta is a workaround for you.

Current Version: https://github.com/rodneyviana/ODSyncService/tree/master/Binaries/PowerShell

Beta Version: https://github.com/rodneyviana/ODSyncService/blob/master/Binaries/Beta/OneDriveLib_OnDemand.zip

Unblock-File -Path "C:\ODTool\OneDriveLib.dll" # change path if necessary
Import-Module "C:\ODTool\OneDriveLib.dll"

Get-ChildItem $env:OneDrive | foreach {
$_ | select *,@{Name="ODStatus";Expression={Get-ODStatus -ByPath $_}}
} | Format-Table ODStatus,FullName 

You may format your output using the "Format-Table"

If you have "OnDemandOrUnknown" often/always then add information to this: https://github.com/rodneyviana/ODSyncService/issues/36

  • Related