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(AccountId)) { AccountId = InputHelper.GetUserInput(this, "AccountId"); } if (String.IsNullOrEmpty(OperationId)) { OperationId = InputHelper.GetUserInput(this, "OperationId"); } Latch latch = new Latch(AppId, SecretKey); WriteObject(latch.Lock(AccountId, OperationId), true); } catch (Exception ex) { InvokeCommand.InvokeScript(String.Format("Write-Host Error: \"{0}\"", ex.Message)); } }