Content

你应该选择 Powershell 的10个理由(抛弃 cmd)(powershell用的什么语言)没想到

文章摘要

Get-ChildItem 是一个 PowerShell 命令,用于获取一个或多个指定位置中的文件及其子文件夹(即“子项”)。其语法支持多种参数,如 -Filter、-Depth、-Directory、-Exclude、-Include 等,允许用户根据需求过滤和筛选结果。命令支持递归 (-Recurse) 搜索子目录中的所有文件,并可指定路径和属性筛选。Get-ChildItem 支持的“位置”包括文件系统目录、注册表存档、证书存储等。通过键入“get-help Get-ChildItem”可以获取更多帮助信息。

 PS C:\Users\Haley> help ls 名称 Get-ChildItem 摘要 Gets the items and child items in one or more specified locations. 语法 Get-ChildItem [[-Filter] <String>] [-Attributes {ReadOnly | Hidden | System | Directory | Archive | Device | Normal | Temporary | SparseFile | ReparsePoint | Compressed | Offline | NotContentIndexed | Encrypted | IntegrityStream | NoScrubData}] [-Depth <UInt32>] [-Directory] [-Exclude <String[]>] [-File] [-Force] [-Hidden] [-Include <String[]> ] -LiteralPath <String[]> [-Name] [-ReadOnly] [-Recurse] [-System] [-UseTransaction] [<CommonParameters>] Get-ChildItem [[-Path] <String[]>] [[-Filter] <String>] [-Attributes {ReadOnly | Hidden | System | Directory | Arch ive | Device | Normal | Temporary | SparseFile | ReparsePoint | Compressed | Offline | NotContentIndexed | Encrypte d | IntegrityStream | NoScrubData}] [-Depth <UInt32>] [-Directory] [-Exclude <String[]>] [-File] [-Force] [-Hidden] [-Include <String[]>] [-Name] [-ReadOnly] [-Recurse] [-System] [-UseTransaction] [<CommonParameters>] 说明 The Get-ChildItem cmdlet gets the items in one or more specified locations. If the item is a container, it gets the items inside the container, known as child items. You can use the Recurse parameter to get items in all child cont ainers. A location can be a file system location, such as a directory, or a location exposed by a different Windows PowerSh ell provider, such as a registry hive or a certificate store. 相关链接 Online Version: http://go.microsoft.com/fwlink/?LinkId=821580 Get-Item Get-Location Get-Process Get-PSProvider 备注 若要查看示例,请键入: “get-help Get-ChildItem -examples”. 有关详细信息,请键入: “get-help Get-ChildItem -detailed”. 若要获取技术信息,请键入: “get-help Get-ChildItem -full”. 有关在线帮助,请键入: “get-help Get-ChildItem -online”