{"id":35,"date":"2006-06-06T12:51:00","date_gmt":"2006-06-06T16:51:00","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/2006\/06\/06\/printing-from-powershell\/"},"modified":"2009-10-16T09:05:40","modified_gmt":"2009-10-16T13:05:40","slug":"printing-from-powershell","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/35\/printing-from-powershell\/","title":{"rendered":"Printing from PowerShell"},"content":{"rendered":"<p><span style=\"font-family:tahoma;font-size:78%;\"><span style=\"font-size:100%;\">PowerShell has a slick feature that allows you to send the output from a cmdlet or expression directly to a printer.  Pipe the output to the Out-Printer cmdlet and it will print out on the default printer:<\/p>\n<p><span style=\"font-family: courier new;\">get-process | out-printer<\/span><\/p>\n<p> If you have other printers installed you can use the printer name. For example, I have Adobe Acrobat installed which installs a virtual printer. I can send the output of a command to that printer and generate a pdf:<\/p>\n<p> <span style=\"font-family: courier new;\">get-service |where {$_.status -eq \"stopped\"} |out-printer \"Adobe PDF\"<\/span><\/p>\n<p>If you want to print to a network printer, specify the printer UNC:<\/p>\n<p> <span style=\"font-family: courier new;\">get-service |where {$_.status -eq \"stopped\"} |out-printer \"\\\\Print01\\HPLaserJ\"<\/span><\/p>\n<p>(By the way, you don't have to wrap the printer name in quotes, but I find it a good practice to avoid any confusion, especially when the printer name might have quotes.)<\/p>\n<p>This is also a quick way to print the contents of text files directly from within PowerShell:<\/p>\n<p> <span style=\"font-family: courier new;\">get-content c:\\boot.ini |out-printer \"\\\\Print01\\hplaserj\"<\/span><\/p>\n<p><\/span><\/span><span style=\"font-family:tahoma;font-size:78%;\"><span style=\"font-size:100%;\">There's no page numbering or formatting options but it is a quick way to get a hard copy of you results.<\/span><\/span><br \/><span style=\"font-family:tahoma;font-size:78%;\"><\/p>\n<p>Technorati Tags:<br \/><a href=\"http:\/\/www.technorati.com\/tags\/powershell\" rel=\"tag\">PowerShell<\/a><br \/><a href=\"http:\/\/www.technoratic.com\/tags\/scripting\" rel=\"tag\">Scripting<\/a><br \/><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>PowerShell has a slick feature that allows you to send the output from a cmdlet or expression directly to a printer. Pipe the output to the Out-Printer cmdlet and it will print out on the default printer: get-process | out-printer If you have other printers installed you can use the printer name. For example, I&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,8],"tags":[113,534,111],"class_list":["post-35","post","type-post","status-publish","format-standard","hentry","category-powershell","category-scripting","tag-out-printer","tag-powershell","tag-printer"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Printing from PowerShell &#8226; The Lonely Administrator<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/35\/printing-from-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Printing from PowerShell &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"PowerShell has a slick feature that allows you to send the output from a cmdlet or expression directly to a printer. Pipe the output to the Out-Printer cmdlet and it will print out on the default printer: get-process | out-printer If you have other printers installed you can use the printer name. For example, I...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/35\/printing-from-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2006-06-06T16:51:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2009-10-16T13:05:40+00:00\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/35\\\/printing-from-powershell\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/35\\\/printing-from-powershell\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Printing from PowerShell\",\"datePublished\":\"2006-06-06T16:51:00+00:00\",\"dateModified\":\"2009-10-16T13:05:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/35\\\/printing-from-powershell\\\/\"},\"wordCount\":193,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"Out-Printer\",\"PowerShell\",\"Printer\"],\"articleSection\":[\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/35\\\/printing-from-powershell\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/35\\\/printing-from-powershell\\\/\",\"name\":\"Printing from PowerShell &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2006-06-06T16:51:00+00:00\",\"dateModified\":\"2009-10-16T13:05:40+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/35\\\/printing-from-powershell\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/35\\\/printing-from-powershell\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/35\\\/printing-from-powershell\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Printing from PowerShell\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/\",\"name\":\"The Lonely Administrator\",\"description\":\"Practical Advice for the Automating IT Pro\",\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\",\"name\":\"Jeffery Hicks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"caption\":\"Jeffery Hicks\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Printing from PowerShell &#8226; The Lonely Administrator","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jdhitsolutions.com\/blog\/powershell\/35\/printing-from-powershell\/","og_locale":"en_US","og_type":"article","og_title":"Printing from PowerShell &#8226; The Lonely Administrator","og_description":"PowerShell has a slick feature that allows you to send the output from a cmdlet or expression directly to a printer. Pipe the output to the Out-Printer cmdlet and it will print out on the default printer: get-process | out-printer If you have other printers installed you can use the printer name. For example, I...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/35\/printing-from-powershell\/","og_site_name":"The Lonely Administrator","article_published_time":"2006-06-06T16:51:00+00:00","article_modified_time":"2009-10-16T13:05:40+00:00","author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/35\/printing-from-powershell\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/35\/printing-from-powershell\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Printing from PowerShell","datePublished":"2006-06-06T16:51:00+00:00","dateModified":"2009-10-16T13:05:40+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/35\/printing-from-powershell\/"},"wordCount":193,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["Out-Printer","PowerShell","Printer"],"articleSection":["PowerShell","Scripting"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/35\/printing-from-powershell\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/35\/printing-from-powershell\/","name":"Printing from PowerShell &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2006-06-06T16:51:00+00:00","dateModified":"2009-10-16T13:05:40+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/35\/printing-from-powershell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/35\/printing-from-powershell\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/35\/printing-from-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Printing from PowerShell"}]},{"@type":"WebSite","@id":"https:\/\/jdhitsolutions.com\/blog\/#website","url":"https:\/\/jdhitsolutions.com\/blog\/","name":"The Lonely Administrator","description":"Practical Advice for the Automating IT Pro","publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jdhitsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9","name":"Jeffery Hicks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","caption":"Jeffery Hicks"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":455,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/455\/get-printer\/","url_meta":{"origin":35,"position":0},"title":"Get-Printer","author":"Jeffery Hicks","date":"October 16, 2009","format":false,"excerpt":"I think Out-Printer is a very handy cmdlet, and one that doesn\u2019t get used much. Pipe any cmdlet to it and the output will be printed to your default printer. You use it the same way you would Out-File except output is printed instead of saved to a file. The\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1811,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1811\/export-registry-printer-information-i-came\/","url_meta":{"origin":35,"position":1},"title":"Export Registry Printer Information I came&#8230;","author":"Jeffery Hicks","date":"November 2, 2011","format":false,"excerpt":"Export Registry Printer InformationI came across this post http:\/\/www.oncallpros.com\/2011\/11\/02\/powershell-export-your-print-configuration-from-registry\/ on exporting printer information from the registry in PowerShell. I wanted to offer some constructive suggestions but could find no way to comment so I'll do so here.First, the article introduces some good PowerShell concepts. I like that he is using\u2026","rel":"","context":"In &quot;Google Plus&quot;","block_context":{"text":"Google Plus","link":"https:\/\/jdhitsolutions.com\/blog\/category\/google-plus\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1645,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-ise\/1645\/friday-fun-add-a-print-menu-to-the-powershell-ise\/","url_meta":{"origin":35,"position":2},"title":"Friday Fun Add A Print Menu to the PowerShell ISE","author":"Jeffery Hicks","date":"September 9, 2011","format":false,"excerpt":"I spend a fair amount of time in the PowerShell ISE. One task that I find myself needing, especially lately, is the ability to print a script file. I'm sure you noticed there is no Print menu choice. So I decided to add my own to the ISE. Printing a\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":73,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/73\/powershell-tfm-has-been-a-proofed\/","url_meta":{"origin":35,"position":3},"title":"PowerShell TFM has been a-proofed","author":"Jeffery Hicks","date":"December 10, 2006","format":false,"excerpt":"I saw the galley proofs for Windows PowerShell TFM the other day. It's very exciting. We have to make a few minor changes and then the printer will quickly get to work. I assume the first books will hit the streets in a few weeks. You can still pre-order at\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9040,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/9040\/open-up-wide\/","url_meta":{"origin":35,"position":4},"title":"Open Up Wide","author":"Jeffery Hicks","date":"May 26, 2022","format":false,"excerpt":"I recently read a terrific post from Mike F. Robbins about using Format-Wide to display strings. Format-Wide is one of those cmdlets that I don't think gets much use. This is a shame because it certainly fulfills a need. But as Mike points out, if you have a list of\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/out-widestring-help-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/out-widestring-help-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/out-widestring-help-1.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/out-widestring-help-1.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/out-widestring-help-1.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/05\/out-widestring-help-1.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":1562,"url":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1562\/get-shared-resource\/","url_meta":{"origin":35,"position":5},"title":"Get Shared Resource","author":"Jeffery Hicks","date":"July 12, 2011","format":false,"excerpt":"I was poking around WMI the other day in PowerShell and was intrigued by the Win32_Share class. This is a great way to find out what items are shared on a server such as printers and folders, although it's not limited to those types of resources. I thought this would\u2026","rel":"","context":"In &quot;PowerShell v2.0&quot;","block_context":{"text":"PowerShell v2.0","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-v2-0\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/35","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=35"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/35\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=35"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=35"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=35"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}