Skip to content

Write-RsRestCatalogItem fails in NonInteractive mode after Windows update to PS 5.1 #448

Description

@LSTANCZYK

Write-RsRestCatalogItem (and likely other cmdlets that use Invoke-WebRequest internally) throws the following error in unattended/pipeline environments after a recent Windows update to PowerShell 5.1:

System.Exception: Failed to create catalog item:
Windows PowerShell is in NonInteractive mode. Read and Prompt functionality is not available.
---> System.Management.Automation.PSInvalidOperationException: Windows PowerShell is in NonInteractive mode.
at Microsoft.PowerShell.ConsoleHostUserInterface.HandleThrowOnReadAndPrompt()
at Microsoft.PowerShell.ConsoleHostUserInterface.PromptForChoice(...)
at System.Management.Automation.MshCommandRuntime.DoShouldContinue(...)
at System.Management.Automation.Cmdlet.ShouldContinue(String query, String caption, Boolean hasSecurityImpact, ...)
at Microsoft.PowerShell.Commands.InvokeWebRequestCommand.ProcessResponse(WebResponse response)
at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()

Steps to reproduce

  1. Run any script calling Write-RsRestCatalogItem on a Windows machine with the latest PS 5.1 updates applied
  2. Run it non-interactively (e.g. Azure DevOps pipeline, scheduled task)

Expected behavior

File uploads silently without prompting, as it did before the Windows update.

Actual behavior

Invoke-WebRequest internally calls ShouldContinue(hasSecurityImpact=true) during ProcessResponse. When hasSecurityImpact is true, PowerShell ignores $ConfirmPreference and always prompts — making it impossible to suppress without changing the underlying call to use -UseBasicParsing.

Environment

  • PowerShell 5.1 (post Windows update, exact KB unknown)
  • Azure DevOps pipeline agent (Windows Server)
  • SSRS/PBIRS over HTTPS, Windows Authentication (NTLM)

Suggested fix

Add -UseBasicParsing to all Invoke-WebRequest calls inside the module. This bypasses IE's COM-based response parser (the source of the security prompt) and is safe for all SSRS REST API responses which are plain JSON.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions