11
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

WindowsのPowerShellで環境変数の確認

Posted at

背景

Windowsの環境変数をPowerShellのターミナルから確認したいと思い、
古い記憶から以下のように試してみたところあれ?となってしまったときに調べたときの備忘録です。
これはコマンドプロンプトでの確認方法でした。

> echo %PUBLIC%
%PUBLIC%

指定した環境変数の確認

> echo $env:[環境変数名]

> echo $env:PUBLIC
C:\Users\Public

環境変数は小文字でも大丈夫そうです。

> echo $env:public
C:\Users\Public

環境変数一覧の表示

一覧の表示は以下のようにGet-ChildItemを使うことで表示できます。
Get-ChildItemについて(Microsoft)

> Get-ChildItem env:
11
8
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
11
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?