User Profile
BoydHeeres
Copper Contributor
Joined 3 years ago
User Widgets
Recent Discussions
Re: Is there any way to get the sync status using PowerShell Script?
Hi martinzima, You and steveprentice send me down a rabithole with your conversation. I did some digging into what you both mentioned and I figured out that the command only works when you query the folder you are currently in. With the help of an LLM AI I created a function that reads the information from all the files in the OneDrive and outputs it back out of the function as an object. It is still not perfect, I just noticed that the .exe files are not properly detected for whatever reason and I suspect I will encounter a few more. If I remember I will update this site once I have completed it. $Shell = New-Object -ComObject Shell.Application function Get-ShellDetails { param ( [string]$DirectoryPath ) $ShellNamespace = $Shell.NameSpace($DirectoryPath) $Items = $ShellNamespace.Items() foreach ($Item in $Items) { if ($Item.IsFolder -and -not ($Item.Path -match '\.(zip|tar\.gz|7z|rar|tar|gz|bz2|xz|cab|lzma)$')) { Get-ShellDetails -DirectoryPath $Item.Path # Recursive call for nested directories } elseif (-not ($Item.Path -match '\.(zip|tar\.gz|7z|rar|tar|gz|bz2|xz|cab|lzma)$')) { $ShellDetails303 = $ShellNamespace.getDetailsOf($Item, 303) $MergedObject = [PSCustomObject]@{ FullName = $Item.Path Attributes = (Get-Item -Path $Item.Path).Attributes ShellDetails303 = $ShellDetails303 } $MergedStatus.Add($MergedObject) } }20KViews1like0Comments
Recent Blog Articles
No content to show