Skip to content
PowerShell module for converting Curl commands to PowerShell
Branch: master
Clone or download
ThePoShWolf Merge pull request #24 from ThePoShWolf/parser
Switched from regular expressions to using a parser
Latest commit ada3353 Oct 11, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github adding an issue template Apr 26, 2019
Tests updated the tests to actually work Oct 11, 2019
build/Curl2PS built 0.0.3 Oct 11, 2019
docs initial doc commit Mar 29, 2019
src switched to system.uri Oct 11, 2019
.gitattributes Initial commit Mar 7, 2019 built 0.0.3 Oct 11, 2019
LICENSE Updating license copyright name Oct 11, 2019
Module.PSDeploy.ps1 Added the deploy settings May 8, 2019 Updated readme May 8, 2019
build.ps1 Fixed a c/p typo Apr 5, 2019
notes.ps1 built 0.0.3 Oct 11, 2019


This module is a utility module to help convert curl commands to Invoke-RestMethod syntax.

This module includes classes for dealing with the curl command as well as URLs, but primarily converts curl commands to Invoke-RestMethod syntax with the ConvertTo-IRM function.

To install the module:

Install-Module Curl2PS

Usage examples:

$CurlString = @"
curl -H "X-Auth-Key: 61e5f04ca1794253ed17e6bb986c1702" -H "X-Auth-Workspace:" -H "X-Auth-Signature: " -H "Content-Type: application/json" -H "Accept: application/json" -X GET

PS> $splat = ConvertTo-IRM $CurlString
PS> Invoke-RestMethod @splat

Or if you'd prefer the string command:

ConvertTo-IRM $CurlString -String

Invoke-RestMethod -Uri -Method GET -Headers @{
    'X-Auth-Key' = '61e5f04ca1794253ed17e6bb986c1702'
    'Accept' = 'application/json'
    'X-Auth-Signature' = ''
    'X-Auth-Workspace' = ''
    'Content-Type' = 'application/json'

Or another example:

PS> ConvertTo-IRM -CurlCommand 'curl --request GET ",onhold&role=user&limit=6&format=json"  --data ""' -String

Invoke-RestMethod -Uri -Method GET -Headers @{
    'Authorization' = 'Basic bmNnMWluLThkMXJhZzo1bnVhdXpqNXBrZmZ0bHozZm15a3NteWhhdDZqMzVrZg=='


If you find a curl command that doesn't properly convert, please open an issue!

PRs welcome!

You can’t perform that action at this time.