I have tried to find some alternative way, but not fully successful.
1. I am able to use Invoke-RestMethod to insert all the points from powercli window using:
Invoke-RestMethod -Uri "http://localhost:8086/write?&db=vipl" -Method Post -Body "testtime value=2.2 1457628961`ntesttime value=2.3 1457629321"
2. But, if the same text [ testtime value=2.2 1457628961`ntesttime value=2.3 1457629321 ], I write to a file and later read it using Get-Content like,
$post = Get-Content -Path post.txt
Invoke-RestMethod -Uri "http://localhost:8086/write?&db=vipl" -Method Post -Body "$post"
it shows me an error.
3. Can I know how can I replace EOL with `n
the post.txt contains
[ testtime value=2.2 1457628961
testtime value=2.3 1457629321 ]
how can I make it in this format [ testtime value=2.2 1457628961`ntesttime value=2.3 1457629321 ]
I have tried this {$post = Get-Content -Path post.txt -replace "`n`r ","``n" }
but was unsuccessful