I have made a function that gives users instructions. When I call it I would like to have only 1 page (screen) of info appear at a time.
I've tried using
function1 | Out-Host -paging
and
function1 | more
But neither of them work. The function is a bunch of Write-Host
s. Do I need to define something within the function?
Out-Host expects a stream of objects and write-host does not do that. It simply writes to the console. Instead, use Write-Output and then try Out-Host -Paging.