Preference Variables

PowerShell preferences:

    Variable                         Default Value     Options
    --------                         -------------     --------------------------------
    $ConfirmPreference               High              (none | low | medium | high)
    $DebugPreference                 SilentlyContinue  (Write-Debug) (stop | Inquire | continue | SilentlyContinue)
    $ErrorActionPreference           Continue          (Write-Error) (stop | Inquire | continue | SilentlyContinue)
    $ErrorView                       NormalView        (NormalView | CategoryView)
    $FormatEnumerationLimit          4
    $LogCommandHealthEvent           False (not logged)
    $LogCommandLifecycleEvent        False (not logged)
    $LogEngineHealthEvent            True (logged)
    $LogEngineLifecycleEvent         True (logged)
    $LogProviderLifecycleEvent       True (logged)
    $LogProviderHealthEvent          True (logged)
    $MaximumAliasCount               4096     Max no. of aliases available to the session. Valid values: 1024-32768
    $MaximumDriveCount               4096     Max no. of drives available, excluding those provided by the OS.
    $MaximumErrorCount               256      Valid values: 256 - 32768
    $MaximumFunctionCount            4096     Max no. of functions available to the session.
    $MaximumHistoryCount             64       Max no. of entries saved in the command history. Valid values: 1-32768
    $MaximumVariableCount            4096     Max no. of variables available to the session.
    $OFS                             Space " "  Output Field Separator (converting an array to string.)
    $OutputEncoding                  ASCIIEncoding object
                                     Valid values: Objects derived from an Encoding class, such as:
                                         ASCIIEncoding, SBCSCodePageEncoding, UTF7Encoding,
                                         UTF8Encoding, UTF32Encoding, and UnicodeEncoding.
    $ProgressPreference              Continue       (stop | Inquire | continue | SilentlyContinue)
    $PSEmailServer                   (None)
    $PSModuleAutoloading             Import installed modules automatically.
    $PSSessionApplicationName        WSMAN
    $PSSessionConfigurationName      http://schemas.microsoft.com/powershell/microsoft.powershell 
    $PSSessionOption                 (See below)
    $VerbosePreference               SilentlyContinue   (Write-Verbose) (stop | Inquire | continue | SilentlyContinue)
    $WarningPreference               Continue           (Write-Warning) (stop | Inquire | continue | SilentlyContinue)
    $WhatIfPreference                0

Examples

Display the value of the $ConfirmPreference variable.

PS C:\> $ConfirmPreference
High

Assign the value "Medium" to the $ConfirmPreference variable.

PS C:\> $ConfirmPreference = "Medium"

Setting $OFS (the Output Field Separator) to display an array with different separators:

PS C:\> &{ $a = 1,2,3; "$a"}
  1 2 3

PS C:\> &{ $OFS="-"; $a = 1,2,3; "$a"}
  1-2-3

"Democracy cannot be static. Whatever is static is dead" ~ Eleanor Roosevelt

Related PowerShell Cmdlets:

Variables - Environment variables.
Automatic variables - Variables created and maintained by PowerShell $_, $Args, $Error, $Home etc.
Array Variables


 
Copyright © SS64.com 1999-2019
Some rights reserved