Using PowerShell Here-Strings with Graph APIs

Using PowerShell Here-Strings with Graph API Requests.

A reader was curious about the way of passing data to Graph API requests as shown in an article. It’s because we used PowerShell here-strings to pass request bodies to Graph API requests. Normally, we use hash tables to create a request body containing several parameters and their values, but sometimes it’s easier to use a here-string for the reasons explained here.

To Splat or Not to Splat, That’s the Question

Splatting is an optional PowerShell technique designed to make it easier to pass parameter values for cmdlets. It’s a personal choice whether to use splatting instead of passing values to individual parameters in the command line. Although the Microsoft Graph PowerShell SDK can be a little strange at times, you can use splatting with SDK cmdlets, even with some pretty complex parameters such as those used to filter objects.