जवाबों:
इसके साथ चर नाम उपसर्ग env:
$env:path
तुम भी envड्राइव के माध्यम से सभी चर गणना कर सकते हैं :
Get-ChildItem env:
$Env:Path.Split(';')खुद को पसंद करता हूं (प्रति पंक्ति एक डायरेक्टरी आउटपुट)।
$env:Path -split ';'
-splitएक रेगेक्स ऑपरेटर है, String.Split()नहीं है
gci env:
माथियास जवाब के अलावा।
हालांकि ओपी में उल्लेख नहीं किया गया है, अगर आपको पॉवरशेल विशिष्ट / संबंधित आंतरिक चर भी देखने की आवश्यकता है, तो आपको उपयोग करने की आवश्यकता है Get-Variable:
$ Get-Variable
Name Value
---- -----
$ name
? True
^ gci
args {}
ChocolateyTabSettings @{AllCommands=False}
ConfirmPreference High
DebugPreference SilentlyContinue
EnabledExperimentalFeatures {}
Error {System.Management.Automation.ParseException: At line:1 char:1...
ErrorActionPreference Continue
ErrorView NormalView
ExecutionContext System.Management.Automation.EngineIntrinsics
false False
FormatEnumerationLimit 4
...
इनमें वे सामान भी शामिल हैं जो आपने अपनी प्रोफाइल स्टार्टअप स्क्रिप्ट में सेट किए होंगे।
echo $env:Path