Private/Validate-DefinitionObject.ps1
function Validate-DefinitionObject { [CmdletBinding()] Param ( [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] [ValidateNotNullOrEmpty()] [object]$InputObject ) $InputObject | % { if ($_.GetType() -ne [hashtable]) { Write-Warning "`n$(($InputObject | Out-String).Trim())" throw "Object is not a hashtable." } $_ } } |