Converting the FileSystemObject's Add Method

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

Add

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