I am looking for a method in PowerShell to post a basic string to a php script that looks like this:
<?php
$file = date("Y-m-d_H-i-s") . ".creds";
file_put_contents($file, file_get_contents("php://input"));
?>
I hope you can help me, thank you!
I am looking for a method in PowerShell to post a basic string to a php script that looks like this:
<?php
$file = date("Y-m-d_H-i-s") . ".creds";
file_put_contents($file, file_get_contents("php://input"));
?>
I hope you can help me, thank you!
I would like you to go through the link. It will help you to understand better .It has all the required examples.
You can use the Invoke-WebRequest cmdlet in PowerShell 3.0 and above to make a request to your web/PHP service.
The Invoke-WebRequest cmdlet has a bunch of parameters you can use to customise your request, like -Headers (for setting headers), -Body for setting the body content, and -ContentType for setting the content type of your request.
You'll most probably want to use the -Body parameter of the cmdlet to send your simple string.
Follow the link above for details and some examples.