List 以特定模式导出文件夹列表PowerShell

List 以特定模式导出文件夹列表PowerShell,list,powershell,export,List,Powershell,Export,我需要以特定模式导出文件夹列表 我的代码是 $list = Get-ChildItem -Path c:\test\ -Directory | Select-Object BaseName 我需要最终的输出 <object> folder name here </object> 此处的文件夹名称 所以我可以在以后使用它来更新我拥有的xml文件 我该怎么做?$list=Get ChildItem-Path d:\tmp \-Directory | Select O

我需要以特定模式导出文件夹列表 我的代码是

$list = Get-ChildItem -Path c:\test\  -Directory | Select-Object BaseName 
我需要最终的输出

<object> folder name here </object>
此处的文件夹名称
所以我可以在以后使用它来更新我拥有的xml文件

我该怎么做?

$list=Get ChildItem-Path d:\tmp \-Directory | Select Object@{name=“baseNameInTag”;expression={{0}”-f$\u0.BaseName}
$list = Get-ChildItem -Path d:\tmp\  -Directory | Select-Object @{name="baseNameInTag"; expression = {"<object>{0}</object>" -f $_.BaseName}}