Skip to content

Instantly share code, notes, and snippets.

@torgro
Created March 23, 2017 15:04
Show Gist options
  • Save torgro/1f4173869191adeb90a884dae285dd0c to your computer and use it in GitHub Desktop.
Save torgro/1f4173869191adeb90a884dae285dd0c to your computer and use it in GitHub Desktop.
$keys = $PSCmdlet.MyInvocation.BoundParameters.Keys
foreach ($key in $keys)
{
$keyValue = @{
$true = ",$key"
$false = "?patchFields=$key"
}
$queryParams += $keyValue.($PSCmdlet.MyInvocation.BoundParameters.ContainsKey($key))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment