Anybody were able to manage package upload and install using power-shell in windows not using cURL? please share some thoughts?
One things is sure cURL is lot easier than power shell.I am also aware cURL can be used in power-shell... But in nutshell i want to use similar to Invoke-RestMethod.
http://psscripts.blogspot.com/2012/09/powershell-v30-invoke-webrequest.html
Thanks,
Chandra
Solved! Go to Solution.
Views
Replies
Total Likes
Hi Chandra gupta What is the specific reason of using powershell instead of curl, and specific use case? Basically you need to checkout powershell equivalent of curl commands. Yous can find all curl commands at :- https://gist.github.com/sergeimuller/2916697 For example, "curl -u {user}:{pass} {url}" equivalent of powershell is $webclient = new-object system.net.webclient; $User = "user"; $PWord = ConvertTo-SecureString –String "P@sSwOrd" –AsPlainText -Force $Credential = New-Object –TypeName System.Management.Automation.PSCredential –ArgumentList $User, $PWord; $webclient.Credentials = $Credential; $webclient.DownloadString('url'); You can even call crul commands from powershell, if this could help you Link:- http://stackoverflow.com/questions/30807318/running-curl-via-powershell-how-to-construct-arguments. I hope this would help you. Thanks and Regards Kautuk Sahni |
Views
Replies
Total Likes
Hi Chandra gupta What is the specific reason of using powershell instead of curl, and specific use case? Basically you need to checkout powershell equivalent of curl commands. Yous can find all curl commands at :- https://gist.github.com/sergeimuller/2916697 For example, "curl -u {user}:{pass} {url}" equivalent of powershell is $webclient = new-object system.net.webclient; $User = "user"; $PWord = ConvertTo-SecureString –String "P@sSwOrd" –AsPlainText -Force $Credential = New-Object –TypeName System.Management.Automation.PSCredential –ArgumentList $User, $PWord; $webclient.Credentials = $Credential; $webclient.DownloadString('url'); You can even call crul commands from powershell, if this could help you Link:- http://stackoverflow.com/questions/30807318/running-curl-via-powershell-how-to-construct-arguments. I hope this would help you. Thanks and Regards Kautuk Sahni |
Views
Replies
Total Likes