Skip to content

[Bug] Stop-ADTServiceAndDependencies ignore -ErrorAction SilentlyContinue #1334

@LMS235

Description

@LMS235

Prerequisites

PSAppDeployToolkit version

4.0.5

Describe the bug

If a service is NOT available, an error occurs with the following command although ‘-ErrorAction SilentlyContinue’ is specified.

Stop-ADTServiceAndDependencies -Service 'ServiceName' -ErrorAction SilentlyContinue

Normally I would expect the script to simply continue with ‘-ErrorAction SilentlyContinue’ (SilentlyContinue or Ignore).

Instead, PSADT cancels completely and returns ERROR 60001

Image

Steps to reproduce

Use Stop-ADTServiceAndDependencies -Service 'ServiceName' -ErrorAction SilentlyContinue and an non existing service

Environment data

OsName               : Microsoft Windows 11 Enterprise
OsOperatingSystemSKU : EnterpriseEdition
OsArchitecture       : 64-Bit
WindowsVersion       : 2009
WindowsProductName   : Windows 10 Enterprise
WindowsBuildLabEx    : 26100.1.amd64fre.ge_release.240331-1435

Metadata

Metadata

Assignees

Labels

Type: Issue / BugSomething isn't working as expected

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions