Powershell - 建立資料夾



Cmdlet

New-Item cmdlet 用於透過使用 -Path 作為目錄路徑和 -ItemType 作為目錄來建立目錄。

示例

在此示例中,我們將在 D:\Temp\ 中建立一個名為“Test Folder”的資料夾

在 PowerShell ISE 控制檯中鍵入以下命令

New-Item -Path 'D:\temp\Test Folder' -ItemType Directory

輸出

您將看到以下輸出。

Directory: D:\temp

Mode                LastWriteTime     Length Name                                               
----                -------------     ------ ----                                               
d----          4/3/2018   7:06 PM            Test Folder   

您可以在 Windows 資源管理器中看到相同的內容,其中 Test Folder 建立在 D:/temp 資料夾中。

powershell_files_folders.htm
廣告
© . All rights reserved.