windows:powershell:variable

環境変数 / 自動変数 / ユーザ定義変数

$ Get-ChildItem env:

Or

$ gci env:
Name                           Value
----                           -----
ALLUSERSPROFILE                C:\ProgramData
APPDATA                        C:\Users\tomoyan\AppData\Roaming
asl.log                        Destination=file
CommonProgramFiles             C:\Program Files\Common Files
CommonProgramFiles(x86)        C:\Program Files (x86)\Common Files
CommonProgramW6432             C:\Program Files\Common Files
COMPUTERNAME                   CMON
ComSpec                        C:\WINDOWS\system32\cmd.exe
DriverData                     C:\Windows\System32\Drivers\DriverData
GETTEXTCLDRDIR                 C:\DevTools\gettext-iconv\gettext-iconv\lib\gettext
GIT_INSTALL_ROOT               C:\Users\tomoyan\scoop\apps\git\current
HOMEDRIVE                      C:
HOMEPATH                       \Users\tomoyan
JAVA_HOME                      C:\jdk-15
JDK_HOME                       C:\jdk-15
LOCALAPPDATA                   C:\Users\tomoyan\AppData\Local
LOGONSERVER                    \\CMON
MSYS2_PATH_TYPE                inherit
NUMBER_OF_PROCESSORS           4
OS                             Windows_NT
Path                           C:\ProgramData\scoop\apps\powershell\current;C:\ProgramData\scoop\s…
PATHEXT                        .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL
POSTGIS_ENABLE_OUTDB_RASTERS   1
POSTGIS_GDAL_ENABLED_DRIVERS   GTiff PNG JPEG GIF XYZ DTED USGSDEM AAIGrid
PROCESSOR_ARCHITECTURE         AMD64
PROCESSOR_IDENTIFIER           Intel64 Family 6 Model 58 Stepping 9, GenuineIntel
PROCESSOR_LEVEL                6
PROCESSOR_REVISION             3a09
ProgramData                    C:\ProgramData
ProgramFiles                   C:\Program Files
ProgramFiles(x86)              C:\Program Files (x86)
ProgramW6432                   C:\Program Files
PSModulePath                   C:\Users\tomoyan\Documents\PowerShell\Modules;C:\Program Files\Powe…
PUBLIC                         C:\Users\Public
PY_PYTHONPATH                  3
SystemDrive                    C:
SystemRoot                     C:\WINDOWS
TEMP                           C:\Users\tomoyan\AppData\Local\Temp
TMP                            C:\Users\tomoyan\AppData\Local\Temp
USERDOMAIN                     CMON
USERDOMAIN_ROAMINGPROFILE      CMON
USERNAME                       tomoyan
USERPROFILE                    C:\Users\tomoyan
windir                         C:\WINDOWS
WSLENV                         WT_SESSION::WT_PROFILE_ID
WT_PROFILE_ID                  {574e775e-4f2a-5b96-ac1e-a2962a402336}
WT_SESSION                     c67b7837-ca5b-4730-b2c1-5f3dca86ba63

Or

$ echo $env:USERPROFILE
C:\Users\tomoyan
$ Get-Variable
Name                           Value
----                           -----
$                              env:
?                              True
^                              Get-ChildItem
args                           {}
ConfirmPreference              High
DebugPreference                SilentlyContinue
EnabledExperimentalFeatures    {}
Error                          {中止: 'C:\Users\tomoyan' 配下にはリポジトリがありません (.hg が見…
ErrorActionPreference          Continue
ErrorView                      ConciseView
Esc
ExecutionContext               System.Management.Automation.EngineIntrinsics
false                          False
FormatEnumerationLimit         4
HOME                           C:\Users\tomoyan
Host                           System.Management.Automation.Internal.Host.InternalHost
InformationPreference          SilentlyContinue
input                          System.Collections.ArrayList+ArrayListEnumeratorSimple
IsCoreCLR                      True
IsLinux                        False
IsMacOS                        False
IsWindows                      True
LASTEXITCODE                   0
MaximumHistoryCount            4096
MyInvocation                   System.Management.Automation.InvocationInfo
NestedPromptLevel              0
null
OutputEncoding                 System.Text.UTF8Encoding
PID                            6476
PROFILE                        C:\Users\tomoyan\Documents\PowerShell\Microsoft.PowerShell_profile.…
ProgressPreference             Continue
PSBoundParameters              {}
PSCommandPath
PSCulture                      ja-JP
PSDefaultParameterValues       {}
PSEdition                      Core
PSEmailServer
pshazz                         {git, theme_name, completions, theme…}
PshazzTabExpansionPatched      True
PSHOME                         C:\ProgramData\scoop\apps\powershell\current
PSScriptRoot
PSSessionApplicationName       wsman
PSSessionConfigurationName     http://schemas.microsoft.com/powershell/Microsoft.PowerShell
PSSessionOption                System.Management.Automation.Remoting.PSSessionOption
PSUICulture                    ja-JP
PSVersionTable                 {PSVersion, PSEdition, GitCommitId, OS…}
PWD                            C:\Users\tomoyan
ShellId                        Microsoft.PowerShell
StackTrace                        at System.Management.Automation.CmdletParameterBinderController.…
true                           True
VerbosePreference              SilentlyContinue
WarningPreference              Continue
WhatIfPreference               False
  • windows/powershell/variable.txt
  • 最終更新: 2020/09/11 19:06
  • by ともやん