protected override void ProcessRecord() { try { if (String.IsNullOrEmpty(AppId)) { AppId = InputHelper.GetUserInput(this, "AppId"); } if (String.IsNullOrEmpty(SecretKey)) { SecretKey = InputHelper.GetUserInput(this, "SecretKey"); } if (String.IsNullOrEmpty(ParentOperationId)) { ParentOperationId = InputHelper.GetUserInput(this, "ParentOperationId"); } Latch latch = new Latch(AppId, SecretKey); WriteObject(String.IsNullOrEmpty(ParentOperationId) ? latch.GetOperations() : latch.GetOperations(ParentOperationId), true); } catch (Exception ex) { InvokeCommand.InvokeScript(String.Format("Write-Host Error: \"{0}\"", ex.Message)); } }