废话不说,直接上实例:
1.copy file or dirPS C:Usersrobin> Copy-Item -Path .PowerShell-Best-Pactise -Destination C:UsersrobinDesktop
2.delete filesPS C:Usersrobin> remove-item .PowerShell-Best-Pactise*
3.delete dirPS C:Usersrobin> remove-item .PowerShell-Best-Pactise
4.create new filePS C:Usersrobin> new-item PowerShell-Best-Pactise
目录: C:Usersrobin
Mode LastWriteTime Length Name
-a---- 2021/9/27 22:56 0 PowerShell-Best-Pactise
5.create dir:PS C:Usersrobin> new-item -path ./ -name logfiles -type directory
目录: C:Usersrobin
Mode LastWriteTime Length Name
d----- 2021/9/27 23:01 logfiles



