Splatting inside an array

I’ve enclosed two registry ‘splats’ inside an array. I really like the way it looks.

Although it works fine, is it best practice ?

# New build tattoo Registry Settings in Array     
$nestedRegKeys = @(
    # Registry Value 1 Splatted
        Path  = $path
        name  = "Task Sequence"
        Value = '$TSeq'
    # Registry Value 2 Splatted
        Path  = $path
        name  = "Build Completed"
        Value = $(Get-Date -Format s)

# Run in new keys
$nestedRegKeys | foreach { New-ItemProperty @_ -Force }

Seems fine to me. Looks a lot like DSC configuration data.

Thanks Dave.

Funky…but heck why not?:grinning:

I don’t see a different between this method and storing the data in an xml file and importing the xml doing the foreach against that data structure.

That’s a cool idea Jonathan using XML to parse in registry keys !
Just cool to experiment with different styles of powershell code. Nice to be different ! :relaxed: