Reputation: 9868
How can I declare an empty array of Objects in Powershell and specify the size?
I basically want to do convert this C# code to Powershell:
Object[] objects = new Object[5];
Upvotes: 1
Views: 2764
Reputation: 22122
$objects=New-Object Object[] 5
or
$objects=[Array]::CreateInstance([Object],5)
Upvotes: 2