Open tommyhosman opened 3 months ago
That's odd. It works perfectly fine on my PC, even if I delete the PowerShell
folder. Does it work if you manually create the folder? How about some other path than $profile
like C:\NewFolderTest\demo.ps1
?
So the FileSystemProvider when -Force
is passed will explicitly try to create all of the intermediate folders. What I wonder here is if your My Documents
is one OneDrive and the folder creation only exists in OneDrive and not on the local filesystem which would explain the error?
Prerequisites
Steps to reproduce
Goal Create profile as described by the documentation
Original issue with PS 5.x.x. But problem persists with PS 7.4.3.
Steps
New-Item -Path $profile -ItemType "file" -Force
Expected behavior
Actual behavior