Udostępnij za pośrednictwem


Windows Azure Powershell 0.6.10 is out and check out $DebugPreference feature to get Request and Response on PS console

Windows Azure Powershell 0.6.10 is out.Check out and you can get 0.6.10 installer from the direct link here. There are several new features are added to this release but the best I like is to setup debugging mode to see request and response data on console. A list of changes you can see here.

To enable debugging you just need to set $DebugPreference as below:

  $DebugPreference ='Continue' 
 To disable debugging you just need to set $DebugPreference as below:
  $DebugPreference ='SilentlyContinue' 
 Example:
 PS>  $DebugPreference ='Continue' 
 PS>Get-AzureService –ServiceName $tempServiceName
  
 DEBUG: ============================ HTTP REQUEST ============================
 
 HTTP Method:
 GET
 
 Absolute Uri:
 https://management.core.windows.net/****************************************/services/hostedservices/avkashwin8
 
 Headers:
 x-ms-version : 2012-03-01
 User-Agent : Windows Azure Powershell/v.0.6.10
 
 Body:
 
 
 DEBUG: ============================ HTTP RESPONSE ============================
 
 Status Code:
 OK
 
 Headers:
 x-ms-request-id : 4ede3883c5e74513af7af675dbe6****
 Content-Length : 623
 Cache-Control : no-cache
 Content-Type : application/xml; charset=utf-8
 Date : Wed, 13 Feb 2013 07:38:19 GMT
 Server : 33.0.6198.5 (rd_rdfe_stable.130128-1959) Microsoft-HTTPAPI/2.0
 
 Body:
 <HostedService xmlns="https://schemas.microsoft.com/windowsazure" xmlns:i="https://www.w3.org/2001/XMLSchema-instance">
 
 <Url>https://management.core.windows.net/*************************/services/hostedservices/avkashwin8</Url>
 <ServiceName>avkashwin8</ServiceName>
 <HostedServiceProperties>
 <Description>Implicitly created hosted service2013-01-17 19:00</Description>
 <Location>West US</Location>
 <Label>*********</Label>
 <Status>Created</Status>
 <DateCreated>2013-01-17T19:00:39Z</DateCreated>
 <DateLastModified>2013-01-21T18:38:35Z</DateLastModified>
 <ExtendedProperties />
 </HostedServiceProperties>
 </HostedService>
 
 DEBUG: ============================ HTTP REQUEST ============================
 
 HTTP Method:
 GET
 
 Absolute Uri:
 https://management.core.windows.net/********************************/operations/4ede3883c5e74513af7af675dbe6****
 
 Headers:
 x-ms-version : 2012-03-01
 User-Agent : Windows Azure Powershell/v.0.6.10
 
 Body:
 
 
 DEBUG: ============================ HTTP RESPONSE ============================
 
 Status Code:
 OK
 
 Headers:
 x-ms-request-id : c15bbbcdd709451ca3699ec8e43957dc
 Content-Length : 232
 Cache-Control : no-cache
 Content-Type : application/xml; charset=utf-8
 Date : Wed, 13 Feb 2013 07:38:20 GMT
 Server : 33.0.6198.5 (rd_rdfe_stable.130128-1959) Microsoft-HTTPAPI/2.0
 
 Body:
 <Operation xmlns="https://schemas.microsoft.com/windowsazure" xmlns:i="https://www.w3.org/2001/XMLSchema-instance">
 <ID>4ede3883-c5e7-4513-af7a-f675dbe6caf5</ID>
 <Status>Succeeded</Status>
 <HttpStatusCode>200</HttpStatusCode>
 </Operation>
 
 Label : avkashwin8
 Description : Implicitly created hosted service2013-01-17 19:00
 AffinityGroup :
 Location : West US
 Status : Created
 DateModified : 2013-01-21T18:38:35Z
 DateCreated : 2013-01-17T19:00:39Z
 Url : https://management.core.windows.net/*************************/services/hostedservices/avkashwin8
 ServiceName : avkashwin8
 OperationDescription : Get-AzureService
 OperationId : 4ede3883-c5e7-4513-af7a-f675dbe6caf5
 OperationStatus : Succeeded
  
 PS>help azure
  PS>help php-dev
 PS>help node-dev
 PS>help python-dev

Comments

  • Anonymous
    February 24, 2013
    With PowerShell 3.0 the way you redirect everything to text including the debug output is to use the "*>" redirection. Example: ((Get-AzureService) | select -first 1 ) *> $env:TEMPout.txt ; ii $env:TEMPout.txt about_Redirection technet.microsoft.com/.../hh847746.aspx