Home>

I am making a greeting code in Ruby using VS code.

puts"Good morning"

puts"Good afternoon"

puts"Good evening"

(Saved)

However, the following error message occurred when displaying it from View → Terminal.

Use PowerShell for the new class platform. https://docs.microsoft.com/ja-jp/powershell/scripting/install/installing-powershell?view=powershell-7

Applicable source code
Excuse me. I'm not sure.
What I tried

Installed the latest version of PowerShell (7.0.2) according to the link displayed in VS code. (I have confirmed it using the code of $PSVersionTable.)

After that, I tried to investigate the correspondence after installation by myself, but I am puzzled because I can not find an article in the same situation.

Supplementary information (FW/tool ​​version, etc.)

〇 Windows 10
Edition Windows 10 Home
Version 1903
System type x 64-bit

Please provide more detailed information here.

This is my first post. Thanks for your understanding.

  • Answer # 1

    VSCode is set to use Windows Powershell by default, but Powershell7 seems to be a different program (just "Powershell") from the previous Windows Powershell.

    Windows 7 running
    PowerShell 7 is installed in a separate directory from Windows PowerShell.

    Source: PowerShell 7.0 New Features | Official Microsoft Documentation

    Therefore, even if Powershell 7 is installed, Windows Powershell is used on VS Code, and it is considered that the message continues to appear.
    So it seems that you need to switch the default shell in VS Code.

    Below setting method
    Click the "3: power shell" part displayed on the right side of the terminal window and select "Select Default Shell".

    At the top of the window, several shell candidates will appear, so select Powershell.

    Now Powershell 7 will be used by default and the message will disappear.


    By the way,

    Use PowerShell for the new class platform. https://docs.microsoft.com/ja-jp/powershell/scripting/install/installing-powershell?view=powershell-7

    Is not an error, it is only recommended and can be ignored.

  • Answer # 2

    I have referred to this article!

    For the 4th Git BUSH exe, just type the red text in the third part of the image that is surrounded by red.

    [Visual Studio code]How to change the terminal