public override void ExecuteCmdlet()
{
if (ParameterSetName == ByFactoryObject)
{
if (DataFactory == null)
{
throw new PSArgumentNullException(string.Format(CultureInfo.InvariantCulture, Resources.DataFactoryArgumentInvalid));
}
DataFactoryName = DataFactory.DataFactoryName;
ResourceGroupName = DataFactory.ResourceGroupName;
}
DataSliceFilterOptions filterOptions = new DataSliceFilterOptions()
{
ResourceGroupName = ResourceGroupName,
DataFactoryName = DataFactoryName,
DatasetName = this.DatasetName,
DataSliceRangeStartTime = StartDateTime,
DataSliceRangeEndTime = EndDateTime
};
int totalDataSlices = 0;
do
{
var dataSlices = DataFactoryClient.ListDataSlices(filterOptions);
totalDataSlices += dataSlices.Count;
WriteObject(dataSlices, true);
} while (filterOptions.NextLink.IsNextPageLink());
if (totalDataSlices == 0)
{
WriteWarning(string.Format(CultureInfo.InvariantCulture, Resources.NoDataSliceFound));
}
}
}