Open cdiskan opened 3 months ago
Thanks for reporting. @BethanyZhou let's consider having different behaviors on ps5/7+
Hi @isra-fel , PowerShell ISE is an integrated scripting Environment different with PowerShell 5/7. I'm not sure if we should support this platform as well?
Let's implement a fall back for ISE. We should check if the terminal (on Windows) supports VT and ISE will return false. In PowerShell, it would be: $host.ui.supportsvirtualterminal
Description
Recent changes to the Connect-AzAaccount cmdlet in the Az.Accounts module cause a display issue when the -DeviceCode switch is used in the PowerShell ISE.
I suspect this is caused by the new display formatting added to the cmdlet.
Example in ISE:![image](https://github.com/Azure/azure-powershell/assets/15149720/47cb172a-62d2-4154-a468-1e2c78143efc)
The device code presented is still valid, however it is bracketed by "[4m" on the starting side of the device code, and "[0m" on the ending side of the device code.
Given the lack of PS v7 support in the ISE this may not be surprising, but figured it should be documented in case other folks stuck on legacy scripting tools run into the issue. The issue does not appear when using the same cmd in the PowerShell v5.1 console, only in the ISE itself.
Issue script & Debug output
Environment data
Module versions
Error output
No response