Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9168597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:39:45+00:00 2026-06-17T15:39:45+00:00

I am trying run a curl command using powershell as follows: $command=.\curl.exe -k -X

  • 0

I am trying run a curl command using powershell as follows:

$command=".\curl.exe -k -X POST --data @login.txt -H ""Content-Type:application/json;charset=utf-8"" https://myserversfqdn:4443/ControlPoint/api/v1/login"

$res= Invoke-Expression $command

It gives me an error saying the splatting operator @ cannot be used to refernce variables in an expression.. so I add the a backtick before @login.txt..

$command=".\curl.exe -k -X POST --data '@login.txt -H ""Content-Type:application/json;charset=utf-8"" https://myserversfqdn:4443/ControlPoint/api/v1/login"

$res= Invoke-Expression $command

Now it gives me an error saying the expression is missing a terminator ‘ (backtick)..
I am lost as to how to I pass the @ character in this command ?? Any guidance is really appreciated

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:39:46+00:00Added an answer on June 17, 2026 at 3:39 pm

    It looks more like you are using the single quote charac ter ' rather than the backtick:

    `

    (Note that the backtick is usually on the same key as the ~ character.)

    But you are half way to your answer, you could also wrap the whole argument in single quotes to pass it as an unparsed string:

    $command=".\curl.exe -k -X POST --data '@login.txt' -H ""Content-Type:application/json;charset=utf-8"" https://myserversfqdn:4443/ControlPoint/api/v1/login"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to run the following command in php to run powershell command... the following
I am trying to post to a REST service using PHP cURL but I'm
i am trying to run following curl command from my ruby code Kernel.system'curl -H
I am trying to install NPM on OSX Lion, I run this command: curl
Trying to get the content of the a certain URL using cURL and PHP.
I'm struggling to translate this command (that I can successfully run) curl -X POST
I'm trying to run curl as a process and capture the output from the
Trying to run Jison unit tests, but the command fails. How do I fix
Im trying to run exe file with c++ with no luck I tried this:
When trying to run an Eclipse Dynamic Web Project under a Tomcat setup using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.