pnp / pnp/powershell

[BUG] Connect-PnPOnline does not respect ErrorAction parameter

Open
#3,683 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
904
Forks
407
Avg merge
9h 16m
Merged PRs (30d)
10

Description

Reporting an Issue or Missing Feature

Issue (migrated from https://github.com/pnp/PnP-PowerShell/issues/2196)

Expected behavior

Connect-PnPOnline -ErrorAction Stop stops script execution on error, e.g. when the URL is wrong.

Actual behavior

The -ErrorAction parameter is being ignored, script execution continues.

Steps to reproduce behavior

Connect-PnPOnline to a bogus tenant url

What is the version of the Cmdlet module you are running?

2.2.0

Which operating system/environment are you running PnP PowerShell on?
  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with Connect-PnPOnline -ErrorAction Stop against a bogus tenant URL using module version 2.2.0 on Windows. Trace how the cmdlet reports connection errors and verify that script execution stops when ErrorAction is set to Stop, while preserving the expected behavior for other error actions.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.