Skip to content

Error with polling from NewSubnetInjection.ps1 script #619

Open
@ArmaanMcleod

Description

@ArmaanMcleod

When choosing to poll with NewSubnetInjection.ps1, there is a failure when converting operational Location to a string.

.\NewSubnetInjection.ps1

cmdlet NewSubnetInjection at command pipeline position 1
Supply values for the following parameters:
environmentId: 00000000-0000-0000-0000-000000000000
policyArmId: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/enterprise-policy-rg/providers/Microsoft.PowerPlatform/enterprisePolicies/power-apps-dev-test-enterprise-policy
Logging In...
Logged In...
Environment reterieved

Enterprise Policy reterieved

WARNING: Resulting JSON is truncated as serialization has exceeded the set depth of 2.
Linking of vnet policy started for environement 00000000-0000-0000-0000-000000000000
Do you want to poll the linking operation (y/n)
y
Polling the link operation every 5 seconds.
InvokeApi: C:\Users\Armaan\Documents\github-repos\PowerApps-Samples\powershell\enterprisePolicies\Common\EnvironmentOperations.ps1:105
Line |
 105 |          $pollResult = InvokeApi -Method GET -Route $operationLink
     |                                                     ~~~~~~~~~~~~~~
     | Cannot process argument transformation on parameter 'Route'. Cannot convert value to type System.String.
Operation polling failed
InvalidOperation: C:\Users\Armaan\Documents\github-repos\PowerApps-Samples\powershell\enterprisePolicies\Common\EnvironmentOperations.ps1:114
Line |
 114 |          if ($operationState.Equals("Failed") -or $operationState.Equa|              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions