๋ค์ ๋ ๋ฌธ์ด ๋ค๋ฅธ ์ถ๋ ฅ์ ์์ฑํ๋ ์ด์ ๋ฅผ ์ดํดํ๋ ค๊ณ ํฉ๋๋ค.
&{,$null} | % {'x'} # x
&{,(1)[1]} | % {'x'} # no output
,$null
๋ฐ ,(1)[1]
๋ชจ๋ ๋จ์ผ null ์์๋ฅผ ํฌํจํ๋ ๋ฐฐ์ด ์ธ ๊ฒ ๊ฐ์ต๋๋ค. ๊ทธ๋ฌ๋ ์คํฌ๋ฆฝํธ ๋ธ๋ก์์ ์ถ๋ ฅํ๋ ๋์ ๋ค๋ฅด๊ฒ ๋์ํฉ๋๋ค. ์ฌ๊ธฐ์ ๋ฌด์จ ์ผ์ด ์ผ์ด๋๊ณ ์์ต๋๊น?
๋ ๋ฒ์งธ๋ ํ์ดํ ๋ผ์ธ์ ์ํด ์ด๊ฑฐ๋์ง ์์ AutomationNull.Value
๋ฅผ ๋ฐํํฉ๋๋ค.
$null
์ด ์ด๊ฑฐ๋ฉ๋๋ค.
์๋ฅผ ๋ค์ด foreach์ ๊ตฌํ์ ์ฐธ์กฐํ์ญ์์ค.
https://github.com/PowerShell/PowerShell/blob/bcf86d4f8a1ce0ef11f0e9100490e790fb067574/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs#L2748
@powercode ๊ฐ์ฌํฉ๋๋ค. ๋ค๋ฅธ ๋
์๋ฅผ ์ํด AutomationNull
์ ๋ํ ๋ช ๊ฐ์ง ๋ฆฌ์์ค๊ฐ ์์ต๋๋ค.
@ alx9r : ์ด๊ฒ์ ๋์ค์ # 6436์์ ๋ฌผ์ด ๋ณธ ์ง๋ฌธ๊ณผ https://github.com/PowerShell/PowerShell/issues/6436#issuecomment -375151317์์ ์ด์ ์ ๋ง์ถ ์ง๋ฌธ์ผ๋ก ๊ท๊ฒฐ๋์ง๋ง ์ ๋ ๊ฒฐ์ ํ์ต๋๋ค ๋ณ๋์ ์ด์ ์์ฑ : # 6823