Product Documentation

Stop-LogHighLevelOperation

Nov 11, 2015

Logs the completion of a previously started high level operation.

Syntax

Stop-LogHighLevelOperation -HighLevelOperationId <String> -IsSuccessful <Boolean> [-EndTime <DateTime>] [-AdminAddress <String>] [<CommonParameters>]

Detailed Description

Stop-LogHighLevelOperation logs the completion of a started high level operation.

Parameters

-HighLevelOperationId<String>

Specifies the identifier of the high level operation being completed.

Required? true
Default Value  
Accept Pipeline Input? false

-IsSuccessful<Boolean>

Specifies if the started high level operation completed sucessfully.

Required? true
Default Value  
Accept Pipeline Input? false

-EndTime<DateTime>

Specifies the end time of the high level operation being completed.

Required? false
Default Value DateTime.UtcNow.
Accept Pipeline Input? false

-AdminAddress<String>

Specifies the address of a XenDesktop controller the PowerShell snap-in will connect to. You can provide this as a host name or an IP address.

Required? false
Default Value Localhost. Once a value is provided by any cmdlet, this value becomes the default.
Accept Pipeline Input? false

Examples

-------------------------- EXAMPLE 1 --------------------------

C:\PS> $succeeded = $false #indicates if high level operation succeeded. 
C:\PS> # Log high level operation start. 
C:\PS> $highLevelOp = Start-LogHighLevelOperation -Text "Create unmanaged catalog" -Source "My Custom Script" 
C:\PS> 
C:\PS> try 
C:\PS> { 
C:\PS>   # Create catalog object 
C:\PS>   $catalog = New-BrokerCatalog -Name "MyCatalog" -ProvisioningType Manual -AllocationType Permanent -MinimumFunctionalLevel 'LMAX' -LoggingId $highLevelOp.Id 
C:\PS> 
C:\PS>   # Add a machine to the catalog 
C:\PS>   $machine = New-BrokerMachine -CatalogUid $catalog.Uid -MachineName "DOMAIN\Machine" -LoggingId $highLevelOp.Id 
C:\PS>   $succeeded = $true 
C:\PS> } 
C:\PS> catch{ "Error encountered" } 
C:\PS> 
C:\PS> finally{ 
C:\PS>   # Log high level operation stop, and indicate its success 
C:\PS>   Stop-LogHighLevelOperation -HighLevelOperationId $highLevelOp.Id -IsSuccessful $succeeded 
C:\PS> }

Creates an unmanaged catalog and assigns a machine to it, within the scope of a high level operation start and stop. The identifier of the high level operation is passed into the "-LoggingId" parameter of the service SDK cmdlets. The execution of the cmdlets in the services will create the low level operation logs for the supplied high level operation.