Assigning to null

Assigning a statement to the null variable is a popular way of dropping unwanted output. It has the advantage of being obvious, in that it appears at the beginning of the statement. This method is fast in all versions of PowerShell:

using namespace System.Text

$stringBuilder = [StringBuilder]::new()
$null = $stringBuilder.AppendFormat('Name: {0}', $service.Name).AppendLine().

AppendFormat('Status: {0}', $service.Status).AppendLine().
AppendLine()
$stringBuilder.ToString()
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.20.238.187