X
Xaba Xaba
Hello, All
I have made specific validation of input parameters in my cmdlet:
protected override void BeginProcessing()
{
if (File.Exists(Output))
{
var message = string.Format("File '{0}' already exists. Do you want to
remove it?", Output);
var result = this.ShouldContinue(message, "File exists");
if (result)
{
File.Delete(Output);
}
else
{
//TODO: Stop cmdlet execution and exit
}
}
// Another validation code
}
protected override void ProcessRecord()
....
And I want to stop cmdlet execution (in place marked as TODO) and abort
execution of ProcessRecord method. How can I do it?
Maybe Cmdlet SDK have special method for abort cmdlet execution...
Thanks
I have made specific validation of input parameters in my cmdlet:
protected override void BeginProcessing()
{
if (File.Exists(Output))
{
var message = string.Format("File '{0}' already exists. Do you want to
remove it?", Output);
var result = this.ShouldContinue(message, "File exists");
if (result)
{
File.Delete(Output);
}
else
{
//TODO: Stop cmdlet execution and exit
}
}
// Another validation code
}
protected override void ProcessRecord()
....
And I want to stop cmdlet execution (in place marked as TODO) and abort
execution of ProcessRecord method. How can I do it?
Maybe Cmdlet SDK have special method for abort cmdlet execution...
Thanks