Open Zerajima opened 3 months ago
the suggested workaround is to invoke "pac.exe" but like you pointed out it is not going to check for latest version which can also a benefit if you run is as part of automated process
That means either hard-coding it to exact version, or forcing users into another installation method, which does not come with pac.launcher.exe. I wanted scripts to be usable in automated build system and available to developers on their own machines. But that means, I have to instruct them not to use the .msi package, if they want the scripts to work correctly.
It's extremely annoying, that simply using another installation method, causes the tool to behave differently. It's not what I would have expected.
Have you looked at dotnet tool
? It installs cross platform version of pac cli
built on top of .net core.
dotnet tool install --global Microsoft.PowerApps.CLI.Tool
I have, but I feel it presents us with a certain danger. As long as my coworkers choose the correct installation method, everything will work as it should. However, if someone installs the .msi package, it will still appear to work correctly, but errors will not be handled properly, which could cause significant problems.
The behavior of the tool should not depend on the installation method.
I have installed pac tool with .msi package. This installs it to "%USERPROFILE%\AppData\Local\Microsoft\PowerAppsCli". This folder is also added to PATH variable. When I invoke pac from command line, it actually invokes pac.bat, which invokes pac.launcher.exe. I assume this application is responsible for figuring out which version of pac tool should be invoked, since multiple can be installed at the same time.
However, this application does not return an error code from pac tool, if one is thrown. The exit code of this application is always 0. This makes it hard to use in PowerShell scripts.
Is there some other way I can detect errors, when invoking pac from PowerShell?