【发布时间】:2015-06-18 12:37:58
【问题描述】:
我有以下 powershell 行:
$items = Get-ChildItem -Path "C:\temp" -Filter "*ä*" -Recurse | Select FullName
我想将这些路径写入 *.txt 文件:
foreach ($item in $items){
add-content -Path C:\temp\test.txt -Value $item -Force
}
test.txt 中的输出:
@{FullName=C:\temp\ä}
我怎样才能只将 FullName 的值写入 txt 文件? 例如:
echo $item
在控制台输出:
C:\temp\ä
【问题讨论】:
-
write-host $item.FullName? -
没想到这么简单,谢谢!
标签: powershell