Different images
Hi.
I am using AppVeyor for several PowerShell module repositories.
I would like to be able to test the code on different versions of powershell.
However all images I tried are on version 5.0.10586.117.
Is there a way to use other versions? 3.0? 4.0? 5.1? Or even Core (6.0)?
Thanks
Oliver
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 02 Jan, 2018 10:21 PM
Hi Oliver,
Right now all our build worker images have PowerShell version 2 and 5 installed. This is default setting for Windows Server 2012 R2 and Windows Server 2016.
If you have a idea how to install another versions of PowerShell on any of those OS (at least manually), we can help you with scripting it and running it at
installstage of different jobs in build matrix.However if it requires different OS (like "Default Windows Servers" in this article), then your best bet would be running your own custom images with private build cloud. However this feature is available for Premium plan customers. We provide 50% discount for open source and trial is free.
Ilya.
2 Posted by oliver on 03 Jan, 2018 11:06 AM
Thanks for the reply.
If I install PowerShell Core (v6) during the
installstage, it will not take over the- ps:blocks, right? (as the exe name is different)I would have to
- cmd: pwsh -File foo.ps1, correct?3 Posted by Ilya Finkelshte... on 04 Jan, 2018 01:10 AM
Correct, please check this sample and this build. I have to admin that this is not exactly the best experiences -- we are thinking about better PowerShell Core support.
4 Posted by oliver on 07 Jan, 2018 06:13 PM
Thank! that helps a lot
This is continued in https://help.appveyor.com/discussions/questions/16616-have-deploy-r...
5 Posted by oliver on 23 Jan, 2018 09:11 PM
Hey @Ilya
Now that PowerShell v6 is officially out... do you already know how to support it in AppVeyor?
IMHO, a new environment variable that would call a script (similar to enable-rdp.ps1) that installs powershell v6 would be really cool, as it would be easy to use in the
matrixblock.6 Posted by Ilya Finkelshte... on 23 Jan, 2018 09:29 PM
Sure PS Core support is already deployed at build workers, so you if prefix commands with
- pwsh:, it will run PowerShell Core. UI part will be deployed today later. No colors in PowerShell Core console for now though, but we work on adding them later (it is tricky).7 Posted by oliver on 24 Jan, 2018 10:03 AM
That's great to hear!
thank you.
The best I could come up, to be able to controle it in the matrix, was this:
In case you know of a simpler/cleaner way to do this, please let me know
8 Posted by Ilya Finkelshte... on 24 Jan, 2018 06:09 PM
Right, this is about all we can come up with if you need to choose PowerShell version in matrix. We are thinking how can we make it nicer, but for now your approach is OK. At least we saved your time on downloading and installing :)
9 Posted by oliver on 24 Jan, 2018 07:28 PM
great, thanks.
shall I open a discussion in case I think of a recommendation on how you can handle this?
10 Posted by Ilya Finkelshte... on 24 Jan, 2018 07:58 PM
Sure. Let us please do it at https://github.com/appveyor/ci/issues.
oliver closed this discussion on 19 Mar, 2018 12:58 PM.