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

Resolve issues caused by breaking changes to PSNativeCommandArgumentPassing in PS 7.3+ #105

Merged
merged 6 commits into from
Feb 9, 2024

Conversation

JamesDawson
Copy link
Contributor

@JamesDawson JamesDawson commented Feb 7, 2024

Relates to changes with how PowerShell processes command-line arguments containing " characters.

References:

Whilst the breaking change was introduced in PS v7.3, any systems that only use LTS versions of PowerShell won't have experienced it until they updated to v7.4.x. Azure DevOps is an example of this, having recently updated the PowerShell version on their hosted agents, which has brought the issue to prominence.

Updated Cmdlets:

  • Assert-AzCliLogin - use legacy PSNativeCommandArgumentPassing to workaround the above breaking change
  • Invoke-AzCli - new switch -UseLegacyNativeCommandArgumentPassing to enable ad-hoc workarounds for the above breaking change
  • Invoke-AzCliRestCommand - uses the above new parameter to resolve errors when running on PowerShell 7.3+ under Linux
  • Set-TemporaryAzureResourceNetworkAccess - fixes an issue with this cmdlet's KeyVault provider

…les for Key Vaults.

The behaviour was being masked by a null reference bug.

We need to handle the fact that Key Vaults stores rules for single IP addresses in CIDR notation (i.e. /32) even when not specified in that form (unlike Storage Accounts) which require single addresses to be specified without the CIDR notation.
…void missing null references."

This reverts commit 8a71ec8.
Copy link

github-actions bot commented Feb 7, 2024

Test Results

575 tests  ±0   575 ✅ ±0   29s ⏱️ +9s
140 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 7938b15. ± Comparison against base commit 5bff3d9.

♻️ This comment has been updated with latest results.

…cmdlet.

This will provide a more flexible way to workaround these types of issues.
Enable 'PSNativeCommandArgumentPassing' Legacy mode to ensure the cmdlet can run on all versions of PowerShell.
@JamesDawson JamesDawson changed the title Fix issue with Set-TemporaryAzureResourceNetworkAccess KeyVault provider Resolve issues caused by breaking changes to PSNativeCommandArgumentPassing in PS 7.3+ Feb 8, 2024
@JamesDawson JamesDawson merged commit 6edc167 into main Feb 9, 2024
16 checks passed
@JamesDawson JamesDawson deleted the feature/kv-tempnetaccess-hotfix branch February 9, 2024 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants