microsoft / powerplatform-vscode

The Power Platform VSCode extension makes it easy to manage Power Platform environments and allows the developer to create, build and deploy Power Platform solutions, packages and portals.
MIT License
211 stars 38 forks source link

Improve commands exit code for scripting #193

Closed nmedda closed 2 years ago

nmedda commented 2 years ago

Description

pac auth select -n ... always return True

I'm creating scripts to help manipulate my solutions in a multi developer setup. But when I select my authentication, it always returns true.

PS > pac auth select -n NonExistingAuth
Microsoft PowerPlatform CLI
Version : 1.14.2+g7205df7

Erreur : Il n'existe aucun profil d'authentification portant le nom « NonExistingAuth »

Utilisation : pac auth select [--index] [--name]

  --index                     Index du profil à activer (alias : -i)
  --name                      Nom du profil à activer (alias : -n)
PS > $?
True

So I need to catch this error somehow, to make sure were not importing a solution if we're not targeting the expected environement.

Suggestion

Return a non zero value if there is no authentication profile that matches the requested name

P.S. : And thanks a ton for your amazing work with pac ;)

davidjenni commented 2 years ago

@nmedda thanks for the feedback (and the team appreciates your thank you :-). I'll move this issue over to our powerplatform-vscode repo/issue tracker, since it is not specific to PALT (we don't have a public GH repo for pac CLI yet, so the pp-vscode is a good in-between for now).

Tracking AzDO item: AB#2693024

petrochuk commented 2 years ago

Fixed in 1.15.1