Behind the PowerShell Pipeline logo

Behind the PowerShell Pipeline

Subscribe
Archives
January 18, 2024

More String Building

Last time, we looked at a number of ways of constructing strings. This is something you might use to create log messages or define variables. There is also the issue of creating a single or multi-line string. That was implied in many of my demos in the previous article. Let’s continue our exploration.

Here’s some sample data from last time.

$c = Get-Volume C -CimSession $env:COMPUTERNAME
$pct = $c.SizeRemaining/$c.Size
$cost = ($c.size - $c.SizeRemaining)/1gb * .05

I want to create a string that looks like this:

Want to read the full issue?
GitHub Bluesky LinkedIn About Jeff
Powered by Buttondown, the easiest way to start and grow your newsletter.