Database Reference
In-Depth Information
Troubleshooting PowerShell Deployments
Windows Azure PowerShell cmdlets provide another way to automate HDInsight cluster provisioning. Basically,
you can use Windows PowerShell to perform a variety of tasks in Windows Azure, either interactively at a command
prompt or automatically through scripts. Windows Azure PowerShell is a module that provides cmdlets to manage
Windows Azure through Windows PowerShell.
You can use the cmdlets to create, test, deploy, and manage your HDInsight clusters on the Windows Azure
platform. The following sections describe ways to enable the logging and debugging of PowerShell script executions,
which can help you track down a cluster-deployment failure.
Using the Write-* cmdlets
PowerShell has built-in cmdlets for logging that use the verb write . Each of the cmdlets is controlled by a shell
variable that ends with Preference argument. For example, to turn the warning messages on, set the variable
$ WarningPreference to Continue .
Table 12-2 summarizes the different types of write cmdlets that PowerShell offers with the usage description for each.
Table 12-2. PowerShell write-* cmdlets
Cmdlet
Function
Write-Debug
The Write-Debug cmdlet writes debug messages to the console from a script or command.
Write-Error
The Write-Error cmdlet declares a nonterminating error. By default, errors are sent in the error
stream to the host program to be displayed, along with output.
Write-EventLog
The Write-EventLog cmdlet writes an event to an event log. To write an event to an event log, the
event log must exist on the computer and the source must be registered for the event log.
Write-Host
The Write-Host cmdlet customizes output. You can specify the color of text by using the
ForegroundColor parameter, and you can specify the background color by using the
BackgroundColor parameter. The Separator parameter lets you specify a string to use to separate
displayed objects. The particular result depends on the program that is hosting Windows PowerShell.
Write-Output
The Write-Output cmdlet sends the specified object down the pipeline to the next command.
If the command is the last command in the pipeline, the object is displayed in the console.
Write-Progress
The Write-Progress cmdlet displays a progress bar in a Windows PowerShell command window
that depicts the status of a running command or script. You can select the indicators that the bar
reflects and the text that appears above and below the progress bar.
Write-Verbose
The Write-Verbose cmdlet writes text to the verbose message stream in Windows PowerShell.
Typically, the verbose message stream is used to deliver information about command processing
that is used for debugging a command.
Write-Warning
The Write-Warning cmdlet writes a warning message to the Windows PowerShell host. The
response to the warning depends on the value of the user's $WarningPreference variable and the
use of the WarningAction common parameter.
 
 
Search WWH ::




Custom Search