On Dec 15, 1:08 pm, "RS" <fp...@xxxxxx> wrote:
> I sure do find this thread useful.
> I have written my first powershell script and want to send it's output
> nightly to our laser printer. Everything seems to be working fine, except
> that my secretary complains that the (default) font is too small to read.
> Now, I'm not sure I've ever installed/deleted/selected or unselected any
> font. So, my question....how can I specify which font or font size I would
> like to be printed at run time. I've looked for an answer now for several
> weeks (out-printer doesn't seem to have anything to help) and just can't
> seem to find anyone talking about printers and fonts. Any help...gulp...
> My application queries an sql db and prepares a unicode report nightly,
> (text), which presently, I'm simply piping to the printer using
From the help file on out-printer:
The Out cmdlets do not format objects; they just render them and send
them to the specified display destination.
No way that i can see to get powershell to change the font size before
sending it to out-printer. What I would suggest is sending the output
to a text file, then opening it with word, changing the size, then
printing it. IE
#Generate a file
Get-Help Get-WmiObject -Full | Out-File -Encoding 'Unicode' -FilePath
Create a Word App
$w=New-Object -ComObject Word.Application
#Load your file
$w.Documents.Add('C:\test.txt') > $null
#If you don't pipe it to null it spits out lots of useless information
#Change Font Size
$w.ActiveDocument.Content.Font.Size = 20
#Send To Default Printer
#Close File Discarding Changes
Not ideal but hopefully its a workaround until someone smarter than I
can help out.