public override void ExecuteCmdlet()
        {
            if (ParameterSetName == StreamAnalyticsObjectsInResourceGroup)
            {
                if (ResourceGroupName != null && string.IsNullOrWhiteSpace(ResourceGroupName))
                {
                    throw new PSArgumentNullException("ResourceGroupName");
                }
            }

            string propertiesToExpand = "inputs,transformation,outputs,functions";

            if (NoExpand.IsPresent)
            {
                propertiesToExpand = string.Empty;
            }

            JobFilterOptions filterOptions = new JobFilterOptions
            {
                JobName            = Name,
                ResourceGroupName  = ResourceGroupName,
                PropertiesToExpand = propertiesToExpand
            };

            WriteObject(StreamAnalyticsClient.FilterPSJobs(filterOptions), true);
        }
        public override void ExecuteCmdlet()
        {
            if (ParameterSetName == SingleStreamAnalyticsObject)
            {
                if (ResourceGroupName != null && string.IsNullOrWhiteSpace(ResourceGroupName))
                {
                    throw new PSArgumentNullException("ResourceGroupName");
                }

                if (Name != null && string.IsNullOrWhiteSpace(Name))
                {
                    throw new PSArgumentNullException("Name");
                }
            }

            string propertiesToExpand = "inputs,transformation,outputs";

            if (NoExpand.IsPresent)
            {
                propertiesToExpand = string.Empty;
            }

            JobFilterOptions filterOptions = new JobFilterOptions
            {
                JobName            = Name,
                ResourceGroupName  = ResourceGroupName,
                PropertiesToExpand = propertiesToExpand
            };

            List <PSJob> jobs = StreamAnalyticsClient.FilterPSJobs(filterOptions);

            if (jobs != null)
            {
                if (jobs.Count == 1 && Name != null)
                {
                    WriteObject(jobs[0]);
                }
                else
                {
                    WriteObject(jobs, true);
                }
            }
        }