Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$nullとAuotmationNullの違い的な奴
$null | % {$i=0} {"$i : $_";$i++}
[System.Management.Automation.Internal.AutomationNull]::Value | % {$i=0} {"$i : $_";$i++}
@("a", $null, "c") | % {$i=0} {"$i : $_";$i++}
@("a", [System.Management.Automation.Internal.AutomationNull]::Value, "c") | % {$i=0} {"$i : $_";$i++}
@stknohg

This comment has been minimized.

Copy link
Owner Author

commented Aug 23, 2019

結果

C:\> $null | % {$i=0} {"$i : $_";$i++}                                                                                  
0 :
C:\> [System.Management.Automation.Internal.AutomationNull]::Value | % {$i=0} {"$i : $_";$i++}                          
C:\> @("a", $null, "c") | % {$i=0} {"$i : $_";$i++}                                                                     
0 : a
1 :
2 : c
C:\> @("a", [System.Management.Automation.Internal.AutomationNull]::Value, "c") | % {$i=0} {"$i : $_";$i++}             
0 : a
1 : c
C:\> 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.