实例:获取指定文件夹中的文件列表代码:
Powershell实例:获取指定文件夹中的文件列表
代码:
$folder = 'C:\Users\UserName\Documents'
# Get a list of all files in the folder
$files = Get-ChildItem -Path $folder -Recurse -File
# Loop through each file and display its name
foreach ($file in $files) {
Write-Host $file.Name
}
本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处
评论列表(69条)