September 5th, 2012

PowerTip: Create a Strongly Typed Array in PowerShell

Doctor Scripto
Scripter

Summary: Learn how to create a strongly typed array.

 

Hey, Scripting Guy! Question I want to create a strongly typed array of system.diagnostics.processes and store it in a variable called $a. How can I do this?

Hey, Scripting Guy! Answer Use a command such as:

[diagnostics.process[]]$a=get-process

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.