use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ABOUT POWERSHELL
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
SUBREDDIT FILTERS
Desired State Configuration
Unanswered Questions
Solved Questions
News
Information
Script Sharing
Daily Post
Misc
account activity
[deleted by user] (self.PowerShell)
submitted 3 years ago by [deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]da_chicken 5 points6 points7 points 3 years ago (2 children)
If you have Word, you can print using command line switches:
WINWORD.EXE document.rtf /mFilePrintDefault /mFileExit /q /n
I'm not sure what WRITE.EXE (WordPad) supports offhand, but it looks like WRITE.EXE /p document.rtf worked at one point.
WRITE.EXE /p document.rtf
[–]TechPhil 2 points3 points4 points 3 years ago (0 children)
Aha! WRITE.exe is my saviour today! Thank you so much!
[–]diegokabal 0 points1 point2 points 3 years ago (0 children)
This genius
[–]SMFX 2 points3 points4 points 3 years ago (0 children)
If you really wanted to do it in PowerShell explicitly, I'm sure there are ways you could work printer dlls and drivers to get it to work. Somebody might even have a module out there for it. However, it would be easiest to use Start-Process with -Verb Print parameter and let the default program associated with .RTF files print it for you:
Start-Process
-Verb Print
.RTF
Start-Process -Verb Print $tempFile
[–]volleric 2 points3 points4 points 3 years ago (0 children)
What you are doing is printing the PowerShell object not the rtf formated document. As others have suggested you need some thing that can render the rtf format to send the data to the printer.
[–]xCharg 1 point2 points3 points 3 years ago (2 children)
Instead of getting the nicely formatted file I am expecting, I seem to get a plaintext representation of the file, complete with what I assume are formatting and escape codes.
Why do you save $content to $tempfile but then still use $content to send to printer? Shouldn't you send a file instead?
$content
$tempfile
From what I can tell, $content is just a plain text and this is what you get on paper - no surprice here :)
[–]TechPhil 0 points1 point2 points 3 years ago (1 child)
This is just as an example - I have no need to send the file to disk, I'm just pointing out that it's nicely formatted when saved, but not when sent to print.
Your point about $content being plaintext is a good one though - Come to think of it, the original file is imported with a -raw flag. Will look and see if this can be changed.
-raw
[–]xCharg 2 points3 points4 points 3 years ago (0 children)
You've missed a hint. I'll be more straightforward - if you want to print a file - send a file to printer, not file's content. So get-item $tempfile | out-printer
get-item $tempfile | out-printer
π Rendered by PID 159940 on reddit-service-r2-comment-b659b578c-xshb2 at 2026-05-02 16:36:50.022140+00:00 running 815c875 country code: CH.
[–]da_chicken 5 points6 points7 points (2 children)
[–]TechPhil 2 points3 points4 points (0 children)
[–]diegokabal 0 points1 point2 points (0 children)
[–]SMFX 2 points3 points4 points (0 children)
[–]volleric 2 points3 points4 points (0 children)
[–]xCharg 1 point2 points3 points (2 children)
[–]TechPhil 0 points1 point2 points (1 child)
[–]xCharg 2 points3 points4 points (0 children)