When I create object in powershell v2 i am unable to access powershell member properties, which will flowlesly works with PowerShell V3. e.g. if i create below object in v3,
$Services = @();
$item = @{};
$item.Name = "ServiceName";
$item.Action = 2;
$item.ActionTime = Get-Date -Format "yyyy-MM-dd HH:mm:ss";
$obj = New-Object PSObject -Property $item;
$Services = $Services + $obj
I can access $services.Action which will be 2, whether on PowerShell v2 it will be blank.
Any help?
thanks