Skip to main content

New answers tagged

1 vote

How to return specific HTTP response code from script that called via Powershell Web API

Thank you, Michael West final solution for me: catch { Write-Host "Error: $_" $context = [System.Web.HttpContext]::Current if ($context) { $context.Response.StatusCode = ...
Александр Кореновский's user avatar
0 votes
Accepted

How to return specific HTTP response code from script that called via Powershell Web API

Can you use something like the following inside your Get-TestContent script? if ($HttpContext){ $HttpContext.Response.StatusCode = 201 }
Michael West's user avatar
  • 18.2k
0 votes

How to return specific HTTP response code from script that called via Powershell Web API

The following information might be useful for you to call Invoke-WebRequest and get the response details. You need to catch the exception and then get the response stream from Response like below. try ...
Sumit Bhatia's user avatar
  • 5,045
0 votes

How to return specific HTTP response code from script that called via Powershell Web API

You can get the response status code in the try catch block using $_.Exception Object. try { $response = Invoke-WebRequest -Uri $uri -UseBasicParsing Write-Host $response.StatusCode } catch { ...
ckhanna's user avatar
  • 396
0 votes

Broken error message within PowerShell Receive-File dialog. Sitecore XP 10.1.2 (rev. 006578)

You can try adding Overwrite option to the receive-file command as below. Receive-File -ParentItem (get-item .) -Overwrite Hope it helps.
ckhanna's user avatar
  • 396

Top 50 recent answers are included