Environment Variables: Unterschied zwischen den Versionen
Aus Wiki-WebPerfect
Admin (Diskussion | Beiträge) |
Admin (Diskussion | Beiträge) |
||
Zeile 1: | Zeile 1: | ||
+ | == Get environment variable == | ||
+ | === Get using "System.Environment" (Scope = System) === | ||
+ | <source lang="powershell>[Environment]::GetEnvironmentVariable('<VariableName>', 'Machine') </source> | ||
− | == Set environment variable (Scope = System) == | + | |
+ | |||
+ | |||
+ | == Set environment variable == | ||
+ | == Set using "System.Environment" (Scope = System) == | ||
<source lang="powershell">[Environment]::SetEnvironmentVariable("<VariableName>", "<VariableValue>", 'Machine') </source> | <source lang="powershell">[Environment]::SetEnvironmentVariable("<VariableName>", "<VariableValue>", 'Machine') </source> | ||
Version vom 5. Mai 2020, 10:26 Uhr
Inhaltsverzeichnis
[Verbergen]Get environment variable
Get using "System.Environment" (Scope = System)
Ungültige Sprache.
Die gewünschte Sprache muss wie folgt definiert werden: <source lang="html4strict">...</source>
Unterstützte Sprachen für die Syntaxhervorhebung:
[Environment]::GetEnvironmentVariable('<VariableName>', 'Machine')
Set environment variable
Set using "System.Environment" (Scope = System)
[Environment]::SetEnvironmentVariable("<VariableName>", "<VariableValue>", 'Machine')
More informations: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_environment_variables?view=powershell-7