DBATools - pass through flat file configs to Agent Job Commands I'm experimenting with source controlling my SQL Agent Jobs &amp; Schedules as .json files and deploying them with the dbatools SQL Agent command suite. 

Given $sa = Get-Credential and foo.config of the below form...

{
    "Schedule":                  "Foo",
    "Disabled":                  false,
    "FrequencyType":             "Weekly",
    "FrequencyInterval":         "EveryDay",
    "FrequencySubdayType":       "Time",
    "FrequencySubdayInterval":   0,
    "FrequencyRelativeInterval": "Unused",
    "FrequencyRecurrenceFactor": 1,
    "StartDate":                 "20180823",
    "EndDate":                   "20181023",
    "StartTime":                 "070000",
    "EndTime":                   "235959"
}


Attempting to use foo.config in a solution fails basic parsing with the following message:

~&gt; $foo = Get-Content foo.config | ConvertFrom-Json
~&gt; New-DbaAgentSchedule @foo -ServerInstance "." -SqlCredential $sa



  WARNING: [15:50:04][New-DbaAgentSchedule] A schedule was not provided! Please provide a schedule name.


Well that sucks... Especially since the following works just fine... 

$bar = @{
    Schedule=                  "Foo"
    Disabled=                  $false
    FrequencyType=             "Weekly"
    FrequencyInterval=         "EveryDay"
    FrequencySubdayType=       "Time"
    FrequencySubdayInterval=   0
    FrequencyRelativeInterval= "Unused"
    FrequencyRecurrenceFactor= 1
    StartDate=                 "20180823"
    EndDate=                   "20181023"
    StartTime=                 "070000"
    EndTime=                   "235959"
}

New-DbaAgentSchedule @bar -ServerInstance "." -SqlCredential $sa


I really don't want to bother typing out each individual ... -Param1 $foo.Param1 -Param2 $foo.Param2 ... because I'm lazy. I would really much rather splat my config files into the various commands. Why won't this work!!?!1!
Well, 4 hours ago self... if you had bothered to inspect the types of $foo and $bar, you might not have wasted a whole afternoon swearing loudly in your open office floor plan as you scroll fruitlessly through the documentation...

~&gt; ($foo | Get-Member).TypeName[0]
System.Management.Automation.PSCustomObject

~&gt; ($bar | Get-Member).TypeName[0]
System.Collections.Hashtable


There's even a convenient, generalized solution on this very Q&amp;A Network for converting a PSCustomObject into a HashTable. 

$foo.psobject.properties | foreach -begin {
    $foo=@{}
} -process {
    $foo."$($_.Name)" = $_.Value
} -end {$foo}

~&gt; New-DbaAgentSchedule @foo -ServerInstance "." -SqlCredential $sa


Easy peasy, lemon squeezy.

So splat away, ya big crazy. And when you're done feeling stupid, maybe share the workaround online in case it helps someone else. And if you're feeling super proactive, maybe consider setting aside some time to contribute to the module.