title: How to store the output of the Invoke-RestMethod into a variable
body: <p>I am trying to store the output of the <code>Invoke-RestMethod</code> into a variable and than exact the output from the variable.</p>
  <pre><code>Invoke-RestMethod -Method POST -Uri $exportURL -Headers $logonHeader -ContentType &quot;application/zip&quot; -TimeoutSec 2700 -OutFile &quot;$PlatformZipPath\$PlatformID.zip&quot; -ErrorAction SilentlyContinue
  $URI = New-Object System.Uri(&quot;$URL_DeployPlatfoms/$Repository/$Valut/$EMV/$platfromTech/$PlatformID.zip&quot;)  
      
  $AF_PWD = ConvertTo-SecureString $JfrogAuthToken -AsPlainText -Force  
  $AFCREDS = New-Object System.Management.Automation.PSCredential ($Jfroguser, $AF_PWD)  
  
  $SOURCE = &quot;$PlatformZipPath\$PlatformID.zip&quot;  
  Invoke-WebRequest -Uri $URI -InFile $SOURCE -Method Put -Credential $AFCREDS   
  </code></pre>
  <p>So, What this piece of code of does is export the cyberark platform and deploy to jfrog artifactory. But the invoke rest method store platform zip locally. I dont want. I want to directly deploy it to artifactory.
  But i dont know how to do that. Please help me with that. Thanks in advance.</p>