다음을 통해 공유


Write-Verbose

Writes text to the verbose message stream.

구문

Default (기본값)

Write-Verbose
    [-Message] <String>
    [<CommonParameters>]

Description

The Write-Verbose cmdlet writes text to the verbose message stream in PowerShell. Typically, the verbose message stream is used to deliver more in depth information about command processing.

By default, the verbose message stream is not displayed, but you can display it by changing the value of the $VerbosePreference variable or using the Verbose common parameter in any command.

예제

Example 1: Write a status message

Write-Verbose -Message "Searching the Application Event Log."
Write-Verbose -Message "Searching the Application Event Log." -Verbose

These commands use the Write-Verbose cmdlet to display a status message. By default, the message is not displayed.

The second command uses the Verbose common parameter, which displays any verbose messages, regardless of the value of the $VerbosePreference variable.

Example 2: Set $VerbosePreference and write a status message

$VerbosePreference = "Continue"
Write-Verbose "Copying file $filename"

These commands use the Write-Verbose cmdlet to display a status message. By default, the message is not displayed.

The first command assigns a value of Continue to the $VerbosePreference preference variable. The default value, SilentlyContinue, suppresses verbose messages. The second command writes a verbose message.

매개 변수

-Message

Specifies the message to display. This parameter is required. You can also pipe a message string to Write-Verbose.

매개 변수 속성

형식:String
Default value:None
와일드카드 지원:False
DontShow:False
별칭:Msg

매개 변수 집합

(All)
Position:0
필수:True
파이프라인의 값:True
속성 이름별 파이프라인의 값:False
나머지 인수의 값:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

입력

String

You can pipe a string that contains the message to this cmdlet.

출력

None

This cmdlet returns no output. It only writes to the verbose message stream.

참고

  • Verbose messages are returned only when the command uses the Verbose common parameter. For more information, see about_CommonParameters.
  • In Windows PowerShell background jobs and remote commands, the $VerbosePreference variable in the job session and remote session determine whether the verbose message is displayed by default. For more information about the $VerbosePreference variable, see about_Preference_Variables.