【发布时间】:2021-03-23 06:05:35
【问题描述】:
我需要有关如何将字符串 -Config 添加到名称列中的每个名称的帮助。
CSV 文件包含:
FullName Name LastWriteTime
\\remotecomputer\ Henry 4/30/2020 3:44:57 PM
\\remotecompter\ Magy 12/7/2020 9:04:28 PM
想要的输出:
FullName Name LastWriteTime
\\remotecomputer\ Henry-Config 4/30/2020 3:44:57 PM
\\remotecompter\ Magy-Config 12/7/2020 9:04:28 PM
我当前的代码:
$InvoiceList = Import-CSV -Path C:\$source-PREP.csv | foreach($list in $InvoiceList){
$Name=$($list.name)
Get-ChildItem -Path 'C:\Names' -Filter *.txt | where {$_.Name -like '*' }|Copy-Item -Destination 'c:\newfolder' -Force }
【问题讨论】:
标签: powershell for-loop replace each