How to use PowerShell 5 on Visual Studio 2016 and PowerShell Core 6 on Visual Studio 2019 and Ubuntu?

Florian Feldhaus's Avatar

Florian Feldhaus

02 Jan, 2020 01:35 PM

In the appveyor config file I'd like to use PowerShell 5 in Visual Studio 2016 images and PowerShell Core 6 in Visual Studio 2019 and Ubuntu images for tests. If I use PS, then PowerShell is used on both Visual Studio 2016 and 2019 and PowerShell Core on Ubuntu. How can I change to PowerShell Core on Visual Studio 2019 but keep PowerShell 5 for Visual Studio 2016?

The current appveyor.yml file can be found here:
https://github.com/NetApp-StorageGRID/S3-Client/blob/master/appveyor.yml

  1. Support Staff 1 Posted by Feodor Fitsner on 02 Jan, 2020 10:23 PM

    Feodor Fitsner's Avatar

    Hi Florian,

    I can't suggest an easy hack for that, but you can switch to using powershell and pwsh commands explicitly, kind of:

    - cmd: powershell ./myscript.ps1
    

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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