PowerShell - How to Create an Array with PSObject

As I told you before in my previous blog post, I was asked to build an interactive PowerShell script for creating Virtual Machines in Azure. In this blog post, I want to show you how I’ve created a report (or array) within PowerShell that: Visualize the to-be-created objects to the user Allows PowerShell to get the data of that array to create Virtual Machines. This makes sure that you have a consistent view of what PowerShell will create for you. See it as an order overview before you buy something online. Let’s imagine I have all the Virtual Machines that I want to create in $VMs. This can be an import of a CSV, or maybe I’ve asked the user for details with “Read-Host” or Out-GridView. ...

10-06-2017 · 2 min · Jean-Paul van Ravensberg