Skip to content

Doesn't pickup calls that are in a variable #134

Description

@AtleeRRN

Component
[X] PowerShell module
[] VSCode extension
[] Other

Description of the issue
Does not seem to migrate commands within a variable.

Describe how to reproduce the issue

Function Confirm-MicrosoftGraphServicePrincipal {
    $graphsp = Get-AzureADServicePrincipal -SearchString "Microsoft Graph"
    if (!$graphsp) {
        $graphsp = Get-AzureADServicePrincipal -SearchString "Microsoft.Azure.AgregatorService"
    }
    if (!$graphsp) {
        Login-AzureRmAccount -Credential $Credential
        New-AzureRmADServicePrincipal -ApplicationId "00000003-0000-0000-c000-000000000000"
        $graphsp = Get-AzureADServicePrincipal -SearchString "Microsoft Graph"
    }
    return $graphsp
}

Will only pick up

1 test.ps1:8:9 Cmdlet ReadyToUpgrade New-AzureRmADServicePrincipal New-AzADServicePrincipal
2 test.ps1:7:9 Cmdlet ReadyToUpgrade Login-AzureRmAccount Login-AzAccount

I expect Get-AzureADServicePrincipal to be changed to Get-AzADServicePrincipal

Environment
PSVersion 7.3.10
https://www.powershellgallery.com/packages/Az.Tools.Migration/11.0.0
Windows 11 22631.3007

Error output

Additional context

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

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