pikesaku’s blog

個人的な勉強メモです。記載内容について一切の責任は持ちません。

PowerShellでCSVを比較する(作成中)

$c1 = Import-Csv .\1222-1.csv
$c2 = Import-Csv .\1222-2.csv
$h = $c1 | Get-Member | Where-Object {$_.MemberType -eq "NoteProperty"} |Select-Object Name
$h = $h.name
$e = ("hoge1","hoge2")
$h2 = $h | ForEach-Object {if ($_ -notin $e) {$_}}
$h2 |ForEach-Object {write-host "$_ ========================"; Compare-Object $c1 $c2 -Property user,$_ -PassThru }