Hi,
I’m want to save output in 2 saperate file, one for http response and other one for payload in .txt files. Below is my code I want to have some idea to get output in .txt files
$Url = " https//...." $Body = @{ Id = " ... "; tokenApi = " .... " } | ConvertTo-Json $Params = @{ Uri = $Url; Method = 'POST'; Body = $Body; ContentType = 'application/json' } $Response = Invoke-RestMethod @Params $Token = $Response.token $Url = " https//...." $Header = @{ Authorization = "Bearer $Token" } $Body = @{ gatewayId = " ...." } | ConvertTo-Json $Params = @{ Uri = $Url; Header = $Header; Method = 'POST'; Body = $Body; ContentType = 'application/json' } $Response = Invoke-RestMethod @Params $Response
Thanks in advance.