I am trying to write a PowerShellCmdlet in C#. It is a PowerShell command to make a REST API call. Here\'s a snippet of the important functions of the code -