LoginSignup
2
2

More than 1 year has passed since last update.

VSCode PowerShell比較演算子スニペット

Posted at

概要

Visual Studio CodeのPowerShell用のスニペットです。

ショートカット 挿入コード
== -eq
!= -ne
> -gt
>= -ge
< -lt
<= -le

インストール

歯車のアイコンを選択し、「ユーザースニペット」を選択します。
01.png

「PowerShell」を選択します。
02.png

「powershell.json」ファイルが開かれました。
03.png

中身を以下に置き換えます。

powershell.json
{
    "equals": {
        "prefix": "==",
        "body": "-eq"
    },
    "not equals": {
        "prefix": "!=",
        "body": "-ne"
    },
    "greater than": {
        "prefix": ">",
        "body": "-gt"
    },
    "greater than or equal": {
        "prefix": ">=",
        "body": "-ge"
    },
    "less than": {
        "prefix": "<",
        "body": "-lt"
    },
    "less than or equal": {
        "prefix": "<=",
        "body": "-le"
    },
}

04.png

使用例

<=を入力し、
05.png

Ctrl+Spaceを押し、
06.png

EnterTabで確定します。
07.png

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2