Hi everyone,
I am trying to use PowerShell to have a package rebuild on request.
What I have so far is
$client = new-object System.Net.WebClient
$client.Credentials = Get-Credential
$client.UploadString("http://localhost:4502/crx/packmgr/service/,json/packages/ExportsFromProd/export-package.zip","param=build")
Can someone please advise where I am going wrong?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi
Please have a look at this slimier forum post:-
// Invoke-RestMethod Powershell for upload and install package in AEM not using cURL
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.
Some Reference articles are:-
Link:- http://thesociablegeek.com/azure/using-curl-in-powershell/
//Using Curl In Powershell
Link:- http://superuser.com/questions/344927/powershell-equivalent-of-curl
// PowerShell equivalent of curl
I hope this would help you.
Thanks and Regards
Kautuk Sahni
Views
Replies
Total Likes
I would compare your http-request with the one from packagemanager.
Views
Replies
Total Likes
Hi
Please have a look at this slimier forum post:-
// Invoke-RestMethod Powershell for upload and install package in AEM not using cURL
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.
Some Reference articles are:-
Link:- http://thesociablegeek.com/azure/using-curl-in-powershell/
//Using Curl In Powershell
Link:- http://superuser.com/questions/344927/powershell-equivalent-of-curl
// PowerShell equivalent of curl
I hope this would help you.
Thanks and Regards
Kautuk Sahni
Views
Replies
Total Likes
Views
Likes
Replies
Views
Like
Replies