C# Class Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet

Represents base class for all Azure cmdlets.
Inheritance: System.Management.Automation.PSCmdlet, IDisposable
Afficher le fichier Open project: Azure/azure-powershell Class Usage Examples

Protected Properties

Свойство Type Description
_adalListener Microsoft.WindowsAzure.Commands.Common.DebugStreamTraceListener
_clientRequestId string
_dataCollectionProfile Microsoft.WindowsAzure.Commands.Common.AzurePSDataCollectionProfile
_errorRecordFolderPath string
_metricHelper Microsoft.WindowsAzure.Commands.Common.MetricHelper
_qosEvent AzurePSQoSEvent
_sessionId string

Méthodes publiques

Méthode Description
AzurePSCmdlet ( ) : Microsoft.ApplicationInsights

Initializes AzurePSCmdlet properties.

Dispose ( ) : void
ExecuteCmdlet ( ) : void
IsDataCollectionAllowed ( ) : bool

Check whether the data collection is opted in from user

Méthodes protégées

Méthode Description
BeginProcessing ( ) : void

Cmdlet begin process. Write to logs, setup Http Tracing and initialize profile

CheckIfInteractive ( ) : bool
ConfirmAction ( bool force, string continueMessage, string processMessage, string target, System.Action action ) : void

Guards execution of the given action using ShouldProcess and ShouldContinue. This is a legacy version forcompatibility with older RDFE cmdlets.

ConfirmAction ( bool force, string continueMessage, string processMessage, string target, System.Action action, Func useShouldContinue ) : void

Guards execution of the given action using ShouldProcess and ShouldContinue. The optional useSHouldContinue predicate determines whether SHouldContinue should be called for this particular action (e.g. a resource is being overwritten). By default, both ShouldProcess and ShouldContinue will be executed. Cmdlets that use this method overload must have a force parameter.

ConfirmAction ( string processMessage, string target, System.Action action ) : void

Prompt for confirmation depending on the ConfirmLevel. By default No confirmation prompt occurs unless ConfirmLevel >= $ConfirmPreference. Guarding the actions of a cmdlet with this method will enable the cmdlet to support -WhatIf and -Confirm parameters.

ConstructPSObject ( string typeName ) : System.Management.Automation.PSObject
CurrentPath ( ) : string
Dispose ( bool disposing ) : void
EndProcessing ( ) : void

Perform end of pipeline processing.

GetDataCollectionProfile ( ) : AzurePSDataCollectionProfile

Get the data collection profile

InitializeDataCollectionProfile ( ) : void

Initialize the data collection profile

InitializeQosEvent ( ) : void
IsVerbose ( ) : bool
LogCmdletEndInvocationInfo ( ) : void
LogCmdletStartInvocationInfo ( ) : void
LogQosEvent ( ) : void

Invoke this method when the cmdlet is completed or terminated.

ProcessRecord ( ) : void
PromptForDataCollectionProfileIfNotExists ( ) : void

Prompt for the current data collection profile

SafeWriteOutputPSObject ( string typeName ) : void
SaveDataCollectionProfile ( ) : void

Save the current data collection profile JSON data into the default file path

SetupDebuggingTraces ( ) : void
SetupHttpClientPipeline ( ) : void
TearDownDebuggingTraces ( ) : void
TearDownHttpClientPipeline ( ) : void
ThrowTerminatingError ( ErrorRecord errorRecord ) : void
WriteCommandDetail ( string text ) : void
WriteDebug ( string text ) : void
WriteDebugWithTimestamp ( string message ) : void
WriteError ( ErrorRecord errorRecord ) : void
WriteErrorWithTimestamp ( string message ) : void
WriteExceptionError ( Exception ex ) : void

Write an error message for a given exception.

WriteObject ( object sendToPipeline ) : void
WriteObject ( object sendToPipeline, bool enumerateCollection ) : void
WriteProgress ( System.Management.Automation.ProgressRecord progressRecord ) : void
WriteVerbose ( string text ) : void
WriteVerboseWithTimestamp ( string message ) : void
WriteWarning ( string text ) : void
WriteWarningWithTimestamp ( string message ) : void

Private Methods

Méthode Description
FlushDebugMessages ( bool record = false ) : void
RecordDebugMessages ( ) : void

Method Details

AzurePSCmdlet() public méthode

Initializes AzurePSCmdlet properties.
public AzurePSCmdlet ( ) : Microsoft.ApplicationInsights
Résultat Microsoft.ApplicationInsights

BeginProcessing() protected méthode

Cmdlet begin process. Write to logs, setup Http Tracing and initialize profile
protected BeginProcessing ( ) : void
Résultat void

CheckIfInteractive() protected méthode

protected CheckIfInteractive ( ) : bool
Résultat bool

ConfirmAction() protected méthode

Guards execution of the given action using ShouldProcess and ShouldContinue. This is a legacy version forcompatibility with older RDFE cmdlets.
protected ConfirmAction ( bool force, string continueMessage, string processMessage, string target, System.Action action ) : void
force bool Do not ask for confirmation
continueMessage string Message to describe the action
processMessage string Message to prompt after the active is performed.
target string The target name.
action System.Action The action code
Résultat void

ConfirmAction() protected méthode

Guards execution of the given action using ShouldProcess and ShouldContinue. The optional useSHouldContinue predicate determines whether SHouldContinue should be called for this particular action (e.g. a resource is being overwritten). By default, both ShouldProcess and ShouldContinue will be executed. Cmdlets that use this method overload must have a force parameter.
protected ConfirmAction ( bool force, string continueMessage, string processMessage, string target, System.Action action, Func useShouldContinue ) : void
force bool Do not ask for confirmation
continueMessage string Message to describe the action
processMessage string Message to prompt after the active is performed.
target string The target name.
action System.Action The action code
useShouldContinue Func A predicate indicating whether ShouldContinue should be invoked for thsi action
Résultat void

ConfirmAction() protected méthode

Prompt for confirmation depending on the ConfirmLevel. By default No confirmation prompt occurs unless ConfirmLevel >= $ConfirmPreference. Guarding the actions of a cmdlet with this method will enable the cmdlet to support -WhatIf and -Confirm parameters.
protected ConfirmAction ( string processMessage, string target, System.Action action ) : void
processMessage string The change being made to the resource
target string The resource that is being changed
action System.Action The action to perform if confirmed
Résultat void

ConstructPSObject() protected méthode

protected ConstructPSObject ( string typeName ) : System.Management.Automation.PSObject
typeName string
Résultat System.Management.Automation.PSObject

CurrentPath() protected méthode

protected CurrentPath ( ) : string
Résultat string

Dispose() public méthode

public Dispose ( ) : void
Résultat void

Dispose() protected méthode

protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

EndProcessing() protected méthode

Perform end of pipeline processing.
protected EndProcessing ( ) : void
Résultat void

ExecuteCmdlet() public méthode

public ExecuteCmdlet ( ) : void
Résultat void

GetDataCollectionProfile() protected static méthode

Get the data collection profile
protected static GetDataCollectionProfile ( ) : AzurePSDataCollectionProfile
Résultat Microsoft.WindowsAzure.Commands.Common.AzurePSDataCollectionProfile

InitializeDataCollectionProfile() protected static méthode

Initialize the data collection profile
protected static InitializeDataCollectionProfile ( ) : void
Résultat void

InitializeQosEvent() protected abstract méthode

protected abstract InitializeQosEvent ( ) : void
Résultat void

IsDataCollectionAllowed() public static méthode

Check whether the data collection is opted in from user
public static IsDataCollectionAllowed ( ) : bool
Résultat bool

IsVerbose() protected méthode

protected IsVerbose ( ) : bool
Résultat bool

LogCmdletEndInvocationInfo() protected méthode

protected LogCmdletEndInvocationInfo ( ) : void
Résultat void

LogCmdletStartInvocationInfo() protected méthode

protected LogCmdletStartInvocationInfo ( ) : void
Résultat void

LogQosEvent() protected méthode

Invoke this method when the cmdlet is completed or terminated.
protected LogQosEvent ( ) : void
Résultat void

ProcessRecord() protected méthode

protected ProcessRecord ( ) : void
Résultat void

PromptForDataCollectionProfileIfNotExists() protected abstract méthode

Prompt for the current data collection profile
protected abstract PromptForDataCollectionProfileIfNotExists ( ) : void
Résultat void

SafeWriteOutputPSObject() protected méthode

protected SafeWriteOutputPSObject ( string typeName ) : void
typeName string
Résultat void

SaveDataCollectionProfile() protected abstract méthode

Save the current data collection profile JSON data into the default file path
protected abstract SaveDataCollectionProfile ( ) : void
Résultat void

SetupDebuggingTraces() protected méthode

protected SetupDebuggingTraces ( ) : void
Résultat void

SetupHttpClientPipeline() protected méthode

protected SetupHttpClientPipeline ( ) : void
Résultat void

TearDownDebuggingTraces() protected méthode

protected TearDownDebuggingTraces ( ) : void
Résultat void

TearDownHttpClientPipeline() protected méthode

protected TearDownHttpClientPipeline ( ) : void
Résultat void

ThrowTerminatingError() protected méthode

protected ThrowTerminatingError ( ErrorRecord errorRecord ) : void
errorRecord System.Management.Automation.ErrorRecord
Résultat void

WriteCommandDetail() protected méthode

protected WriteCommandDetail ( string text ) : void
text string
Résultat void

WriteDebug() protected méthode

protected WriteDebug ( string text ) : void
text string
Résultat void

WriteDebugWithTimestamp() protected méthode

protected WriteDebugWithTimestamp ( string message ) : void
message string
Résultat void

WriteError() protected méthode

protected WriteError ( ErrorRecord errorRecord ) : void
errorRecord System.Management.Automation.ErrorRecord
Résultat void

WriteErrorWithTimestamp() protected méthode

protected WriteErrorWithTimestamp ( string message ) : void
message string
Résultat void

WriteExceptionError() protected méthode

Write an error message for a given exception.
protected WriteExceptionError ( Exception ex ) : void
ex System.Exception The exception resulting from the error.
Résultat void

WriteObject() protected méthode

protected WriteObject ( object sendToPipeline ) : void
sendToPipeline object
Résultat void

WriteObject() protected méthode

protected WriteObject ( object sendToPipeline, bool enumerateCollection ) : void
sendToPipeline object
enumerateCollection bool
Résultat void

WriteProgress() protected méthode

protected WriteProgress ( System.Management.Automation.ProgressRecord progressRecord ) : void
progressRecord System.Management.Automation.ProgressRecord
Résultat void

WriteVerbose() protected méthode

protected WriteVerbose ( string text ) : void
text string
Résultat void

WriteVerboseWithTimestamp() protected méthode

protected WriteVerboseWithTimestamp ( string message ) : void
message string
Résultat void

WriteWarning() protected méthode

protected WriteWarning ( string text ) : void
text string
Résultat void

WriteWarningWithTimestamp() protected méthode

protected WriteWarningWithTimestamp ( string message ) : void
message string
Résultat void

Property Details

_adalListener protected_oe property

protected DebugStreamTraceListener,Microsoft.WindowsAzure.Commands.Common _adalListener
Résultat Microsoft.WindowsAzure.Commands.Common.DebugStreamTraceListener

_clientRequestId protected_oe property

protected string _clientRequestId
Résultat string

_dataCollectionProfile protected_oe static_oe property

protected static AzurePSDataCollectionProfile,Microsoft.WindowsAzure.Commands.Common _dataCollectionProfile
Résultat Microsoft.WindowsAzure.Commands.Common.AzurePSDataCollectionProfile

_errorRecordFolderPath protected_oe static_oe property

protected static string _errorRecordFolderPath
Résultat string

_metricHelper protected_oe property

protected MetricHelper,Microsoft.WindowsAzure.Commands.Common _metricHelper
Résultat Microsoft.WindowsAzure.Commands.Common.MetricHelper

_qosEvent protected_oe property

protected AzurePSQoSEvent _qosEvent
Résultat AzurePSQoSEvent

_sessionId protected_oe static_oe property

protected static string _sessionId
Résultat string