【发布时间】:2021-11-10 21:04:58
【问题描述】:
【问题讨论】:
标签: excel powershell
【问题讨论】:
标签: excel powershell
将您的 Excel 保存为 CSV 文件
然后在 PowerShell 中执行:
$csv = Import-Csv -Path 'X:\theFile.csv' -Header 'path','exists' -UseCulture
foreach ($item in $csv) {
$item.exists = if (Test-Path -Path $item.path) {'OK'} else {'error'}
}
# re-save the file
$csv | Export-Csv -Path 'X:\theFile.csv' -UseCulture -NoTypeInformation
最后双击该文件以在 Excel 中打开
【讨论】: