Skip to content

New-ServiceControlInstance not returning/bubbling errors correctly #1565

@TraGicCode

Description

@TraGicCode

I'm currently trying to automate the installation and management of Service Control instances and notice that it seems the New-ServiceControlInstance Cmdlet is not returning errors back to the caller (my powershell script) correctly causing me to be unable to determine if the new instance was created successfully or failed because of errors or prequisites.

When running

PS C:\Users\vagrant> New-ServiceControlInstance -Name Test -Transport MSMQ -InstallPath c:\install -DBPath c:\db -LogPath c:\logs -Port 12 -AuditRetentionPeriod "15.0:0:0" -ErrorRetentionPeriod "15.0:0:0" -ForwardAuditMessages -DatabaseMaintenancePort 2 -ErrorVariable MyError

I see an error stating MSMQ is not installed as shown below

WARNING: HostName set to default value 'localhost'
WARNING: AuditQueue set to default value 'audit'
WARNING: ErrorQueue set to default value 'error'
WARNING: ServiceAccount set to default value 'LocalSystem'
WARNING: AuditLogQueue set to default value 'audit.log'
VERBOSE: Installing Service Control instance...
MSMQ Service is not installed
Each of the queue names specified for a instance should be unique
PS C:\Users\vagrant>

By checking my error variable named MyError that was passed into the cmdlet is always returned as an ArrayList of count 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions