protected override void ProcessRecord() { string rawJsonContent = StreamAnalyticsClient.ReadJsonFileContent(this.TryResolvePath(File)); Name = ResolveResourceName(rawJsonContent, Name, "Output"); if (Name != null && string.IsNullOrWhiteSpace(Name)) { throw new ArgumentException(Resources.OutputNameCannotBeEmpty); } CreatePSOutputParameter parameter = new CreatePSOutputParameter { ResourceGroupName = ResourceGroupName, JobName = JobName, OutputName = Name, RawJsonContent = rawJsonContent, Force = Force.IsPresent, ConfirmAction = ConfirmAction }; WriteObject(StreamAnalyticsClient.CreatePSOutput(parameter)); }
public override void ExecuteCmdlet() { string rawJsonContent = StreamAnalyticsClient.ReadJsonFileContent(this.TryResolvePath(File)); Name = ResolveResourceName(rawJsonContent, Name, "Transformation"); if (Name != null && string.IsNullOrWhiteSpace(Name)) { throw new ArgumentException(Resources.TransformationNameCannotBeEmpty); } CreatePSTransformationParameter parameter = new CreatePSTransformationParameter { ResourceGroupName = ResourceGroupName, JobName = JobName, TransformationName = Name, RawJsonContent = rawJsonContent, Force = Force.IsPresent, ConfirmAction = ConfirmAction }; WriteObject(StreamAnalyticsClient.CreatePSTransformation(parameter)); }
public override void ExecuteCmdlet() { if (ResourceGroupName != null && string.IsNullOrWhiteSpace(ResourceGroupName)) { throw new PSArgumentNullException("ResourceGroupName"); } if (JobName != null && string.IsNullOrWhiteSpace(JobName)) { throw new PSArgumentNullException("JobName"); } if (File != null && string.IsNullOrWhiteSpace(File)) { throw new PSArgumentNullException("File"); } string rawJsonContent = StreamAnalyticsClient.ReadJsonFileContent(this.TryResolvePath(File)); Name = ResolveResourceName(rawJsonContent, Name, "Function"); if (Name != null && string.IsNullOrWhiteSpace(Name)) { throw new ArgumentException(Resources.FunctionNameCannotBeEmpty); } RetrieveDefaultPSFunctionDefinitionParameter parameter = new RetrieveDefaultPSFunctionDefinitionParameter { ResourceGroupName = ResourceGroupName, JobName = JobName, FunctionName = Name, RawJsonContent = rawJsonContent }; WriteObject(StreamAnalyticsClient.RetrieveDefaultPSFunctionDefinition(parameter)); }