'Powershell: Create folder with '.' in the name

I am trying to create a folder that has '.' in the name using following command in Powershell without success:

New-Item -ItemType Directory -Force -Path "MyDocuments.pictures"

It silently fails, without throwing any exception or error. I also have administrator privileges when running this command.



Solution 1:[1]

Path is not the Folder itself but the Folder in which you want to create your folder. This works for me:

$DirName = "MyDocuments.pictures"
New-Item -ItemType Directory -Path "C:\temp" -Name $DirName | Out-Null
Get-Item "C:\temp\$DirName"

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 DSSO21