- 
                Notifications
    You must be signed in to change notification settings 
- Fork 403
Closed
Description
Steps to reproduce
This does not happen if you have a file only containing:
Az.Monitor\Get-AzDataCollectionRuleAssociationThus:
- 
VSCode settings.jsoncontains:"powershell.codeFormatting.useCorrectCasing": true.
- 
Create temp.ps1with 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 
- 
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
- PowerShell v7.4.5
- vscode-powershell v2024.2.2
- PSScriptAnalyzer in vscode-powershell v2024.2.2: v1.22.0