We have automated deployment of webs and lists with PowerShell (PnP). We noticed that some of our views have got the "Type" (DocIcon) column visible but we did not script it to include that column in the views.
After some analysis I found out, that the "Type" (DocIcon) column gets added by SharePoint automatically to the default view, as soon as a folder is created.
As we created folders in the lists to break permission inheritance we see this problem occur, as soon as we create the first item (a background mechanism creates a folder for the item with the desired permissions on it).
I tried to solve it, with setting "EnableFolderCreation" to false on the list, but it changed nothing.
Funny thing is, that I even created a folder and an item in it using PnP PowerShell after list creation (they would be deleted afterwards), before we setup the views (without DocIcon). But still, as soon as I create the first item manually, the DocIcon column appeares in the default view. But when I then delete all the folders/items from the list, also remove the DocIcon column from the default view, and then create an item again (with a folder automatically in the background) - the DocIcon column does NOT reappear in the default view.
So I don't understand, why it works the second time, but not the first time when I "manually" create some dummy item/folder to trick the mechanism.
Any ideas to get rid of this SharePoint default behaviour?