-2
Compare-Object 결과의 값을 지정하려고했지만 출력에 대한 추가 정보를 얻고 있습니다. 이 스크립트 된 runing의Compare-Object 사용 후 배열에 값 할당
$a = (dir C:\_pc\*).BaseName
$b = (dir C:\Users\username\Documents\folder\Jezyki\*).BaseName
$c = (Compare-Object -IncludeEqual -ExcludeDifferent $a $b)
foreach ($element in $c) {
"$element"
}
Write-Output ($c)
출력 예 :
@{InputObject=FolderName; SideIndicator===}
나를 위해, 당신이 무엇을 요구하고 있는지 분명하지 않습니다. 당신은 무엇을 성취 할 수 없습니까? –
Compare-Object -IncludeEqual -ExcludeDifferent $ a $ b에서 값을 가져 와서 $ c라는 배열에 할당하려고합니다. – AESTHETICS
어쩌면 당신은'$ c = (Compare-Object -IncludeEqual -ExcludeDifferent $ a $ b) | 선택 -expand InputObject' –