Reads properties for multiple items.

Read-MultiDataSequential accepts a base object and a list of properties. While values are being entered,
generate a new object from the base object and the additional properties.

To stop entering values, provide no value for any property for a whole object.

PS C:\> Read-MultiData -BaseObject ([pscustomobject]@{ Test = $true }) -Properties InstanceNumber

Prompts for InstanceNumber 3 times, emitting objects with two properties (InstanceNumber with the supplied value, and Test being $true).

function Read-MultiDataSequential {
    PARAM (
        # Property names to populate
        # A base object.
        [psobject]$BaseObject = [pscustomobject]@{}

    Write-Host "To exit, enter no value for one whole object."
        [array]$Data = foreach($Name in $Properties){
                Key = $Name
                Value = Read-Host -Prompt $Name

        if(!($Data.Value | Where-Object { ![string]::IsNullOrEmpty($_) })){

        Select-Object -InputObject $BaseObject -Property @(
            foreach($Datum in $Data){
                    Name = $Datum.Key
                    Expression = [scriptblock]::Create("""$($Datum.Value -replace '"', '""')""")