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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.