PowerShell和文件系统相关的cmdletPowerShell中有大量与文件系统(驱动器、文件夹、文件)相关的cmdlet,为了便于对文件系统的操作,把这些cmdlet收集总结一下是相当必要的。文件系统相关的cmdlet在名称上大多带上Item和Path这样的关键字,所以,我们可以通过如下命令来把这些cmdlet找出来。PS C:\Users\zhanghong> Get-Command -noun item*,path输出如下:CommandType Name Definition----------- ---- ----------Cmdlet Clear-Item Clear-Item [-Path] <String[]...Cmdlet Clear-ItemProperty Clear-ItemProperty [-Path] <...Cmdlet Convert-Path Convert-Path [-Path] <String...Cmdlet Copy-Item Copy-Item [-Path] <String[]>...Cmdlet Copy-ItemProperty Copy-ItemProperty [-Path] <S...Cmdlet Get-Item Get-Item [-Path] <String[]> ...Cmdlet Get-ItemProperty Get-ItemProperty [-Path] <St...Cmdlet Invoke-Item Invoke-Item [-Path] <String[...Cmdlet Join-Path Join-Path [-Path] <String[]>...Cmdlet Move-Item Move-Item [-Path] <String[]>...Cmdlet Move-ItemProperty Move-ItemProperty [-Path] <S...Cmdlet New-Item New-Item [-Path] <String[]> ...Cmdlet New-ItemProperty New-ItemProperty [-Path] <St...Cmdlet Remove-Item Remove-Item [-Path] <String[...Cmdlet Remove-ItemProperty Remove-ItemProperty [-Path] ...Cmdlet Rename-Item Rename-Item [-Path] <String>...Cmdlet Rename-ItemProperty Rename-ItemProperty [-Path] ...Cmdlet Resolve-Path Resolve-Path [-Path] <String...Cmdlet Set-Item Set-Item [-Path] <String[]> ...Cmdlet Set-ItemProperty Set-ItemProperty [-Path] <St...Cmdlet Split-Path Split-Path [-Path] <String[]...Cmdlet Test-Path Test-Path [-Path] <String[]>...看到了吗,很容易就把这些与文件系统相关的cmdlet找出来了,有文件或文件夹对象的,有路径的,有兴趣的朋友一个个cmdlet去研究一下。如果大家觉得光是这个干瘪的cmdlet不好理解,那可以对照一下相关的别名(Alias),就好懂了。命令如下:Get-Alias -Definition *-item*, *-path* | Select-Object Name, Definition输出如下:Name Definition---- ----------cli Clear-Itemclp Clear-ItemPropertycopy Copy-Itemcp Copy-Itemcpi Copy-Itemcpp Copy-ItemPropertydel Remove-Itemerase Remove-Itemgi Get-Itemgp Get-ItemPropertyii Invoke-Itemmi Move-Itemmove Move-Itemmp Move-ItemPropertymv Move-Itemni New-Itemrd Remove-Itemren Rename-Itemri Remove-Itemrm Remove-Itemrmdir Remove-Itemrni Rename-Itemrnp Rename-ItemPropertyrp Remove-ItemPropertysi Set-Itemsp Set-ItemPropertycvpa Convert-Pathrvpa Resolve-Path关于PowerShell中的与文件系统相关的cmdlet,洪哥就说这么多,希望对大家有所帮助,谢谢!