Don't write status/progress information to the output stream
powercode opened this issue · comments
For example in ConnectDevAccount.cs, we have
this.WriteObject($"Developer account {devAccount.Name} has successfully signed in.");
this.WriteObject(devAccount);
This make the cmdlets much harder to use from powershell, since we have to filter noise from the real output.
Use some of the other streams for this kind of information. In that case that would probably be the Information stream, or maybe write noting at all.
But the object stream should be reserved for actual data.
DisconnectDevAccount.cs has the same issue, and so has GetDevAccount.cs.
GetPublishStatus.cs has
this.WriteObject($"Status: {response.Result.Status}");
if (!string.IsNullOrEmpty(response.Result.StatusMessage))
{
this.WriteObject($"Status Message: {response.Result.StatusMessage}");
}
This brings us back to the string parsing of yore.
It should be changed to
this.WriteObject(response.Result.Status);
That contains both properties and can be consumed without string parsing.