Another option:
$string = "example blabla"
$string -replace '(.)', "`$1`n"
You could also do the replacement like this:
$string -replace '', "`n"
but that way the output will have a leading newline.
By wrapping the replacement in a function like this:
function Fold {
param(
[CmdletBinding()]
[Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true)]
[string]$String,
[Parameter()]
[alias('w')]
$Width=80
)
$String -replace "(.{$Width})", "`$1`n"
}
you could use it in (more or less) the same way as the shell utility:
PS C:\> Fold -w:1 'example blabla'
e
x
a
m
p
l
e
f
o
o
PS C:\> 'example blabla' | Fold -w:5
examp
le bl
abla