Run parts of test_script only on Visual Studio 2017 image?
I have several "steps" in my test_script that only work if Visual Studio 2017 is installed, to be specific:
- "\"%ProgramFiles(x86)%\\Microsoft Visual Studio\\Installer\\vswhere\" -property installationPath -products * -all"
- "\"%ProgramFiles(x86)%\\Microsoft Visual Studio\\Installer\\vswhere\" -property installationPath -all"
- "\"%ProgramFiles(x86)%\\Microsoft Visual Studio\\Installer\\vswhere\" -property installationPath -legacy"
Is there a way to run those only on the VIsual Studio 2017 image, and not on the VS2015 one where it will crash as the file doesn't exist?
Thanks, Jan
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

1 Posted by Ilya Finkelshte... on 14 Feb, 2018 07:40 PM
There are many ways to do so. You can condition your script with
APPVEYOR_BUILD_WORKER_IMAGEEnvironment variable or usetest-pathPowerShell command to check that file exists. Or similar command in CMD.2 Posted by Jan Pio on 14 Feb, 2018 10:46 PM
Ah, that simple:
Not pretty but does the job. Thanks.
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:27 AM.