偏好变量

2024年8月29日 | 1 分钟阅读

首选项变量是那些自定义 Windows PowerShell 行为的变量。 任何用户都可以更改这些变量的值。 这些变量会影响 PowerShell 运行环境以及在该环境中运行的所有命令。

下表列出了首选项变量及其默认值

变量默认值
$ConfirmPreference
$DebugPreferenceSilentlyContinue
$ErrorActionPreferenceContinue
$ErrorViewNormalView
$FormatEnumerationLimit4
$InformationPreferenceSilentlyContinue
$LogCommandHealthEventFalse (未记录)
$LogCommandLifecycleEventFalse (未记录)
$LogEngineHealthEventTrue (已记录)
$LogEngineLifecycleEventTrue (已记录)
$LogProviderLifecycleEventTrue (已记录)
$LogProviderHealthEventTrue (已记录)
$MaximumHistoryCount4096
$OFS(空格字符(" "))

变量默认值
$OutputEncodingUTF8Encoding 对象
$ProgressPreferenceContinue
$PSDefaultParameterValues(无 - 空哈希表)
$PSEmailServer(无)
$PSModuleAutoLoadingPreference全部
$PSSessionApplicationNameWSMAN
$PSSessionConfigurationNamehttp://schemas.microsoft.com/PowerShell/microsoft.PowerShell
$PSSessionOption参见 $PSSessionOption
$VerbosePreferenceSilentlyContinue
$WarningPreferenceContinue
$WhatIfPreference0

下一主题PowerShell 数组