Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

Converting the FileSystemObject's Add Method

Windows PowerShell

Definition: Adds a new folder to a collection of folders. This is similar to the CreateFolder method.


In PowerShell, you use the New-Item cmdlet to create a new folder, specifying three parameters:

  • -path The path to the new folder.

  • -name The name of the new folder.

  • -type The type of item you’re creating. In this case we’re creating a directory.

New-Item -path C:\Scripts -name "New Folder" -type directory

PowerShell has also aliased the DOS command mkdir for creating a new folder:

mkdir "C:\Scripts\New Folder"

See conversions of other FileSystemObject methods and properties.
Return to the VBScript to Windows PowerShell home page

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft