The question is probably best explained with the scenario, where I realized the two programs are operating differently.
I had an old backup from my Linux days on my hard drive containing a file named con. As MSDN states, con is a reserved device name and may not be used for files:
Do not use the following reserved device names for the name of a file:
CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9
So I had problems deleting the file, but with proper name escaping as I found it in this command from a Super User answer, I was able to delete it:
del "\\.\F:\Movies\Con Man\Con.Man.2018.720p.WEBRip.x264-[YTS.AM].mp4"
First, I tried to delete the file with the given command via PowerShell. It threw an error saying the directory or drive does not exist. Only C:\WINDOWS\System32\cmd.exe was able to delete the file. I ran both shells with administrator permissions.
So from this point I simply wanted to know: Why do they behave differently? Is there some sort of sepearate permission level for PowerShell or is it running in some sort of special sandbox?
con
, is it?