Verbose, Parameter

PowerShell Verbose Parameter

Some cmdlets can provide verbose data. This is disabled by default but can be enabled by using the -Verbose parameter. This can be useful if you want to log an action or troubleshoot your scripts.

To view an example of this we will look at the Set-Alias cmdlet:

PS C:\> Set-Alias Time Get-Date -Verbose
VERBOSE: Performing operation "Set Alias" on Target "Name: Time Value: Get-Date".
PS C:\>

As I said some cmdlets doesn’t provide verbose information so if we use the parameter with the Get-Date cmdlet it doesn’t provide any additional verbose data:

PS C:\> Get-Date -Verbose

Monday, July 28, 2008 7:48:33 AM
PS C:\>

Generally you will find that the Verbose parameter works on PowerShell cmdlets that make some kind of change to the system.

0 comments ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment