protected override void ProcessRecord()
{
if (ParameterSetName == ByFactoryObject)
{
if (DataFactory == null)
{
throw new PSArgumentNullException(string.Format(CultureInfo.InvariantCulture, Resources.DataFactoryArgumentInvalid));
}
DataFactoryName = DataFactory.DataFactoryName;
ResourceGroupName = DataFactory.ResourceGroupName;
}
ConfirmAction(
Force.IsPresent,
string.Format(
CultureInfo.InvariantCulture,
"Are you sure you want to suspend pipeline '{0}' in data factory '{1}'?",
Name,
DataFactoryName),
string.Format(
CultureInfo.InvariantCulture,
"Suspending pipeline '{0}' in data factory '{1}'.",
Name,
DataFactoryName),
Name,
() => DataFactoryClient.SuspendPipeline(ResourceGroupName, DataFactoryName, Name));
WriteObject(true);
}