Skip to content

New-Item cmdlet fails to create folder on PowerShell 7.0.0-preview.2 #10177

@amitsara

Description

@amitsara

Steps to reproduce

  1. Create Ubuntu 18.04 VM in Azure
  2. wget https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-preview.2/powershell-preview_7.0.0-preview.2-1.ubuntu.18.04_amd64.deb
  3. sudo apt install ./powershell-preview_7.0.0-preview.2-1.ubuntu.18.04_amd64.deb
  4. pwsh-preview
  5. new-item -ItemType Directory ./newfolder

In bash run

export LC_ALL=C.UTF-8
export LANG=C.UTF-8
pwsh

Then, run

 New-Item -ItemType Directory ./bas

Expected behavior

new folder is created.


Actual behavior

PS /home/amitsaraf> new-item -ItemType Directory ./newfolder
new-item : The type is not a known type for the file system. Only "file","directory" or "symboliclink" can be specified.
At line:1 char:1

  • new-item -ItemType Directory ./newfolder
  • CategoryInfo : InvalidArgument: (:) [New-Item], PSArgumentException
  • FullyQualifiedErrorId : Argument,Microsoft.PowerShell.Commands.NewItemCommand

Environment data


Metadata

Metadata

Assignees

Labels

Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-FixedThe issue is fixed.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions