I'm sure this has been asked a million times, but I can't figure out why I can't run this simple command in powershell:
PS> new-item -path c:\users\me\desktop\testfolder -name (get-date).txt -value (get-date).toString() -itemtype file
I am forever getting the following error:
New-Item : Access to the path 'C:\Users\Me\desktop\testfolder' is denied. ... PermissionDenied: ... UnauthorizedAccessException ... FullyQualifiedErrorId: NewItemUnauthorizedAccessError,Microsoft.PowerShell...
I've tried ALL of the following, to no avail:
- Running powershell as Administrator (i.e, "Run as Administrator")
- Set-ExecutionPolicy RemoteSigned
- "takeown" on the folder
- setting the security settings on the folder to: "everyone > full control"
Where the heck should I go hunting for an answer next? I'm an administrator on my local machine. This is extremely frustrating not to have rights to do something as simple as creating a stupid text file...