Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UseCorrectSpacing removes <module>\ from <module>\<cmdlet> in vscode-powershell #2023

Open
o-l-a-v opened this issue Aug 22, 2024 · 0 comments

Comments

@o-l-a-v
Copy link

o-l-a-v commented Aug 22, 2024

Steps to reproduce

This does not happen if you have a file only containing:

Az.Monitor\Get-AzDataCollectionRuleAssociation

Thus:

  1. VSCode settings.json contains: "powershell.codeFormatting.useCorrectCasing": true.

  2. Create temp.ps1 with following content:

    Write-Information -MessageData 'Adding associations.'
    $DCRs | ForEach-Object -ThrottleLimit $DCRs.'Count' -Parallel {
        $null = Add-Member -InputObject $_ -MemberType 'NoteProperty' -Force -Name 'associations' -Value (
            [array](
                Az.Monitor\Get-AzDataCollectionRuleAssociation -SubscriptionId $_.'subscriptionId' `
                    -ResourceGroupName $_.'resourceGroup' -DataCollectionRuleName $_.'name'
            )
        )
    } 6>$null
  3. Save. The content becomes:

    Write-Information -MessageData 'Adding associations.'
    $DCRs | ForEach-Object -ThrottleLimit $DCRs.'Count' -Parallel {
        $null = Add-Member -InputObject $_ -MemberType 'NoteProperty' -Force -Name 'associations' -Value (
            [array](
                Get-AzDataCollectionRuleAssociation -SubscriptionId $_.'subscriptionId' `
                    -ResourceGroupName $_.'resourceGroup' -DataCollectionRuleName $_.'name'
            )
        )
    } 6>$null

Expected behavior

Content should not change.

Actual behavior

Az.Monitor\ gets stripped.

Environment data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants