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

"az bot msteams create" commands fails in local powershell but works in azure cloud shell #12257

Closed
jaijitendra opened this issue Feb 18, 2020 · 5 comments

Comments

@jaijitendra
Copy link

Bug:
"az bot msteams create" command fails in local PowerShell but works in azure cloud shell.

Local powershell:
az cli version : 2.0.81
image

Azure cloud powershell shell:
az cli version : 2.0.81
image


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@jiasli
Copy link
Member

jiasli commented Feb 19, 2020

I believe you are running this command in [DBG] mode which warns about messages in stderr. The command actually succeeds. If you check $result, it should contain the correct result.

I can repro in vscode while in [DBG] mode:

[DBG]: PS C:\Users\xxx> $result = az group list --verbose
az : INFO: command ran in 1.486 seconds.
At line:1 char:11
+ $result = az group list --verbose
+           ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (INFO: command ran in 1.486 seconds.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

You may mute it with $result = az group list --verbose 2>$null. If you run the command in normal mode, it won't trigger this warning.

@jiasli jiasli added the Shell label Feb 19, 2020
@jiasli jiasli self-assigned this Feb 19, 2020
@jaijitendra
Copy link
Author

jiasli, you are right. It works in non-debug mode but command still fails in debug mode even though I have added --verbose 2>$null

image

@jiasli
Copy link
Member

jiasli commented Feb 19, 2020

This seems like a PowerShell issue PowerShell/PowerShell#11133

  1. What is your system?
  2. Which is your PowerShell version?
  3. How did you enter DBG mode?

@yonzhan yonzhan added this to the S167 milestone Feb 19, 2020
@jaijitendra
Copy link
Author

What is your system?
Ans : Windows 10 build 19041.113
Which is your PowerShell version?
Ans: v7.0.0-rc3
How did you enter DBG mode?
Ans: From PS integrated console in VS code.

@jiasli
Copy link
Member

jiasli commented Apr 21, 2020

Thank you @jaijitendra, I tested in PowerShell 7.0.0 again and the issue seems to be gone.

[DBG]: PS C:\Users\me> $PSVersionTable


Name                           Value
----                           -----
PSVersion                      7.0.0
PSEdition                      Core
GitCommitId                    7.0.0
OS                             Microsoft Windows 10.0.18363
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}       
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

[DBG]: PS C:\Users\me> $result = az group list --verbose    

command ran in 2.633 seconds.
[DBG]: PS C:\Users\me> 

Another option is to turn off the warning.

[DBG]: PS C:\Users\me> $ErrorActionPreference="SilentlyContinue"

[DBG]: PS C:\Users\me> $result = az group list --verbose        

[DBG]: PS C:\Users\me> 

If the preview warning is causing problem, you may use --only-show-errors of Azure CLI to disable that. We introduced it in #12604:

[Core] PREVIEW: Add --only-show-errors global argument to mute all warning, info and debug output. It can also be enabled by setting AZURE_CORE_ONLY_SHOW_ERRORS environment variable to True or [core] only_show_errors=True config (#12544)

@jiasli jiasli closed this as completed Apr 29, 2020
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

3 participants