Skip to content

$MatchingOverFlowCQ.Name = Optimize-DisplayName -String $ The property 'Name' cannot be found on this object. Verify that the property exists and can be set. #47

@myrcinos

Description

@myrcinos

Hi,

First of all, I would like to say that this script is fantastic. The fact that I probably found a bug doesn't change this :)

For some Auto Attendants the script is failing:

$MatchingOverFlowCQ.Name = Optimize-DisplayName -String $ …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The property 'Name' cannot be found on this object. Verify that the property exists and can be set.

a few moments later:

$MatchingTimeoutCQ.Name = Optimize-DisplayName -String $M …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The property 'Name' cannot be found on this object. Verify that the property exists and can be set.

and one more time:

 if (Compare-Object -ReferenceObject $nestedVoiceApps -DifferenceO …
     |                                          ~~~~~~~~~~~~~~~~
     | Cannot bind argument to parameter 'ReferenceObject' because it is null.

This happens when script is looking into a Call Queue. I have checked and there are no dead references.

I did a little bit of investigation and here is what I found:

When scripts tries to set the variable: $MatchingOverFlowCQ.Name = Optimize-DisplayName -String $MatchingOverFlowCQ.Name
the object/variable $MatchingOverFlowCQ is empty.

Ealier in the script where the variable is defined:
$MatchingOverFlowCQ = ($allCallQueues | Where-Object {$_.ApplicationInstances -contains $MatchingCQ.OverflowActionTarget.Id})
there is a reference to:
$MatchingCQ

This variable is set in line 1394 but for some reason the script does not even process this line. I put a brakpoint there and it did not reach it at all.

I assume the same thing happens with $MatchingTimeoutCQ.Name.

Any help is appreciated.

Thx
Marcin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions