cl in AppVeyor powershell

Hi

why the command "cl" in Appveyor powershell pops up an exception as below while in powershell on my PC, no exception is throw?

usage: cl [ option... ] filename... [ /link linkoption... ]
cl : Microsoft (R) C/C++ Optimizing Compiler Version 18.00.40629 for x86
At line:20 char:3
+ cl
+ ~~
    + CategoryInfo : NotSpecified: (Microsoft (R) C...0.40629 for x86:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
Copyright (C) Microsoft Corporation. All rights reserved.
 
 
Command executed with exception: Copyright (C) Microsoft Corporation. All rights reserved.
 
 
echo on_failure
on_failure
echo on_finish
on_finish

  1. You run it as PowerShell script (not CMD) and it looks like that command writes to StdErr which is interpreted by PowerShell as exception.

  2. That's not exactly the point. I run cl under PS on my PC and there is no error as show below

    Z:\git\poco>cl
    Compilateur d'optimisation Microsoft (R) C/C++ version 18.00.30723 pour x64
    Copyright (C) Microsoft Corporation. Tous droits réservés.

    utilisation : cl [ option... ] nom de fichier... [ /link linkoption... ]

    Z:\git\poco>powershell
    Windows PowerShell
    Copyright (C) 2009 Microsoft Corporation. Tous droits réservés.

    PS Z:\git\poco> cl
    Compilateur d'optimisation Microsoft (R) C/C++ version 18.00.30723 pour x64
    Copyright (C) Microsoft Corporation. Tous droits réservés.

    utilisation : cl [ option... ] nom de fichier... [ /link linkoption... ]
    PS Z:\git\poco>

  3. Try running it in PowerShell ISE

  4. Do you mean AppVeyor jobs are run in the Powershel ISE context?

  5. No, but my guess is that treating StdErr depends on PowerShell host.

  6. zosrothko closed this discussion on 17 May, 2018 09:04 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac