Why aren’t you string quoting all of your paths anyway? I’m confused because the vast majority of paths wouldn’t work the way you’re suggesting.
Comment on [deleted]
UmeU@lemmy.world 8 months ago
One drive is the one that really ruffles my feathers.
It turns itself back on randomly, which wouldn’t be too much of a problem except for that it fucking remaps the desktop… a file that was previously located at C:\user\desktop\ is now at C:\user\One Drive\desktop…
Note the space in the path, they didn’t even have the decency to use an underscore… \one_drive\… even though it’s one of their own rules in powershell scripting.
For those of us using powershell to automate stuff this remapping is a nightmare and should be illegal.
Too bad I am in the US and will just have to continue to get support calls from time to time when a users desktop gets remapped behind the scenes.
Maybe there is a way using powershell and windows scheduled tasks to check to see if one drive turned itself back on, then auto turn it off and remap the desktop back to normal.
The absurdity of having windows check to see if windows screwed itself up, then if so have it fix itself is just laughable.
Simon@lemmy.dbzer0.com 8 months ago
UmeU@lemmy.world 8 months ago
Even something as simple as:
move-item “C:\Users\computername\Desktop\afiletomove.csv” (“C:\Users\computername\Desktop\destinationFolder\newFileName (0:MMddyyyy).csv” -f (get-date))
Stops working as intended when your desktop no longer resides at that path.
Also, I have the same functions running on multiple machines with different names so I have to dynamically resolve the path and piece it together using strings.
Simon@lemmy.dbzer0.com 8 months ago
Okay, so if your source path changes, your script stops working? Who knew. Try ([Environment]::GetFolderPath(“Desktop”))
UmeU@lemmy.world 8 months ago
I am using that already, but if I recall, it’s the space in the path ‘\one drive\’ that makes that not work correctly.
squozenode@lemmy.world 8 months ago
Yeah, I reflexively double quote every path. It’s still stupid though.
trustnoone@lemmy.sdf.org 8 months ago
What pisses me off even more is if you start saving too much stuff in your documents/desktop etc you start getting emails from microsoft that your drive is full and you have to purchase more storage (because your harddrive is likely much bigger then your free drive account).
So I know quite a few elderly people who think they now need to pay money to unlock more memory on their computer to save more stuff.
UmeU@lemmy.world 8 months ago
That’s criminal, preying on the elderly. Basically a tech support scam but it’s actually Microsoft running it
AnUnusualRelic@lemmy.world 8 months ago
I’m always surprised at how brazen the corporations are in the US. That kind of shit wouldn’t fly in Europe.
DAMunzy@lemmy.dbzer0.com 8 months ago
That’s so weird. I was just praising M$ to myself because I noticed that they are using \OneDrive\ and \Documents\ now and no spaces to be found.
UmeU@lemmy.world 8 months ago
Nice that might have been something they fixed.
kylian0087@lemmy.world 8 months ago
You know you can completely disable onedrive using GPOs?. I have done so on a DC i have nut it shut also be possible using local GPOs.
OfficerBribe@lemm.ee 8 months ago
Sounds like a weird behavior, are you using Microsoft account for sign-in? Maybe that somehow triggers enabling sync back. Switch to local account if you do not want any benefits MS account gives.
That OneDrive feature is called Known Folder Move and it can be easily disabled. In theory it’s a great feature for most, but I dislike it as well.
I have OneDrive disabled and have never seen it restart automatically.
UmeU@lemmy.world 8 months ago
I have like 10 machines at 5 different locations. In order to share my 365 subscription across multiple machines, I have to have them signed into a Microsoft account. I need excel and ms access working on all my machines.
It’s happen twice since I implemented windows 11, both times after major windows updates.
Not too much trouble to re disable one drive and switch everything back to normal but it breaks a bunch of stuff for me when it happens.
QuaternionsRock@lemmy.world 8 months ago
OneDrive redirection is hilariously bad. Official Microsoft documentation recommends against using it. Imagine having that little faith in your own product.
Image