OneDrive and PowerShell. They remind me of that song, My Favorite Things. Though I’m not sure which I like more, PowerShell or whiskers on kittens. It’s a close call.
I write a lot of little PowerShell scripts to help me get through the day, and often those scripts fiddle with files that are being synced with OneDrive. In a few cases, if the file is large enough, my PowerShell script will fail because OneDrive will lock the file while it’s syncing it. Both responses are totally understandable. I want PowerShell to stop if it can’t sync a file, and I want OneDrive to sync files when I expect it to. I could, and I have in some cases, written a bunch of PowerShell to check the lock status of a file, to deal with the locking issues that OneDrive creates, and so on. It’s tedious though, and honestly I’m not very good at it. That’s where you all come in…
What I really want, nay, need, is a way to pause OneDrive sync while I’m messing with files I know it will lock when syncing. I need two things, Stop-OneDriveSync and Start-OneDriveSync. That’s it. I asked Santa for them for Christmas, but all I got was socks.
So I took the next step, I whined on Twitter. Someone, suggested I create a UserVoice for it. I thought that was pretty solid advice, so I did.
Pause Syncing with PowerShell
What I’m asking from you, is if you too would like to be able to start and stop OneDrive syncing from PowerShell, please vote up the UserVoice. Here it is again in case you missed it.
Pause Syncing with PowerShell
I’ll be keeping an eye on it, and I’ll know if you voted!
Thanks in advance.
tk
ShortURL: https://www.toddklindt.com/PoshPauseOneDrive