tag:help.appveyor.com,2012-11-13:/discussions/questions/45493-how-to-use-powershell-5-on-visual-studio-2016-and-powershell-core-6-on-visual-studio-2019-and-ubuntuAppVeyor: Discussion 2020-04-03T18:47:02Ztag:help.appveyor.com,2012-11-13:Comment/479616812020-01-02T13:35:12Z2020-01-02T13:35:13ZHow to use PowerShell 5 on Visual Studio 2016 and PowerShell Core 6 on Visual Studio 2019 and Ubuntu?<div><p>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?</p>
<p>The current appveyor.yml file can be found here:<br>
<a href="https://github.com/NetApp-StorageGRID/S3-Client/blob/master/appveyor.yml">https://github.com/NetApp-StorageGRID/S3-Client/blob/master/appveyo...</a></p></div>Florian Feldhaustag:help.appveyor.com,2012-11-13:Comment/479616812020-01-02T22:23:21Z2020-01-02T22:23:21ZHow to use PowerShell 5 on Visual Studio 2016 and PowerShell Core 6 on Visual Studio 2019 and Ubuntu?<div><p>Hi Florian,</p>
<p>I can't suggest an easy hack for that, but you can switch to using <code>powershell</code> and <code>pwsh</code> commands explicitly, kind of:</p>
<pre>
<code>- cmd: powershell ./myscript.ps1</code>
</pre></div>Feodor Fitsner