1

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];

1 Answer 1

2
$objects=New-Object Object[] 5

or

$objects=[Array]::CreateInstance([Object],5)
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.