Is is possible to create an object like so
$Data = new-object PSObject
$Data | Add-member NoteProperty -Name "SiteName" -Value "Web Title"
$Data | Add-member NoteProperty -Name "SiteURL" -Value "https://www.test.url"
And then somehow call a function like
Do-CustomFunction $Data
Which would unpack the object and use its attributes as named parameters, to emulate the behavior of:
Do-CustomFunction -SiteName "Web Title" -SiteURL "https://www.test.url"
Param( [string]$SiteName, [string]$SiteUrl)or one object parameterParam( [object]$SiteObject)and inside the function work with the properties of that object:$SiteObject.SiteNameand$SiteObject.SiteUrl. Using ParameterSets allows you to also have a combination of that. Also, you could consider using Splatting but you'll need to use a Hashtable for that.