簡體   English   中英

如何設置 Windows shell 環境變量? 術語“C:\Users\stojko\”未被識別為 cmdlet 的名稱

[英]How to set Windows shell env variable? The term 'C:\Users\stojko\' is not recognized as the name of a cmdlet

我以為這行得通

PS C:\Users\stojko> $env:Path = C:\Users\stojko\
C:\Users\stojko\ : The term 'C:\Users\stojko\' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the
path is correct and try again.
At line:1 char:13
+ $env:Path = C:\Users\stojko\
+             ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\stojko\:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

如果我 go 為

$env

什么都不顯示。

$profile output

C:\Users\stojko\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

如何在 WIndows 10 上設置環境?

這是您需要設置的字符串:

$env:Path = "C:\Users\stojko\"

如果要將其添加到現有列表中:

$env:Path += ";C:\Users\stojko\"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM