{"id":1572,"date":"2011-08-02T08:37:07","date_gmt":"2011-08-02T12:37:07","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=1572"},"modified":"2013-08-20T11:43:06","modified_gmt":"2013-08-20T15:43:06","slug":"byvalue-i-think-hes-got-it","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1572\/byvalue-i-think-hes-got-it\/","title":{"rendered":"ByValue, I Think He&#8217;s Got It"},"content":{"rendered":"<p>Recently I responded to an email from a student seeking clarification about the difference between ByValue and ByProperty when it comes to parameter binding. This is what makes pipelined expressions work in Windows PowerShell.  When you look at cmdlet help, you'll see that some parameters accept pipeline binding, which is what you are looking for.  Often this means you don't need to resort to a ForEach-Object construct. Here's an example.<\/p>\n<p>ByValue means if I see something I'll use it. ByProperty means I'm looking for a specific object property. For example, Get-Service uses the Name property to find a service. <\/p>\n<pre class=\"lang:batch decode:true \" >PS S:\\&gt; help get-service -Parameter Name\r\n\r\n-Name &lt;string[]&gt;\r\n    Specifies the service names of services to be retrieved. Wildcards are permitted. By default, Get-Service gets all\r\n    of the services on the computer.\r\n\r\n    Required?                    false\r\n    Position?                    1\r\n    Default value\r\n    Accept pipeline input?       true (ByValue, ByPropertyName)\r\n    Accept wildcard characters?  true\r\n<\/pre>\n<p>This parameter accepts both types of binding. This means you can do this:<\/p>\n<pre class=\"lang:batch decode:true \" >PS S:\\&gt; \"wuauserv\" | get-service\r\n\r\nStatus   Name               DisplayName\r\n------   ----               -----------\r\nRunning  wuauserv           Windows Update\r\n<\/pre>\n<p>This is an example of byValue. Get-Service sees something in the pipeline and assumes it is a service name. However, for Get-Service this would also work.<\/p>\n<pre class=\"lang:batch decode:true \" >\r\nPS S:\\> $all=get-service\r\nPS S:\\> $all[0] | get-service\r\n\r\nStatus   Name               DisplayName\r\n------   ----               -----------\r\nStopped  AeLookupSvc        Application Experience\r\n<\/pre>\n<p>$all[0] is a service object with name property which when piped to Get-Service, finds the property and binds to it. Here's another example that shows binding by property name can be from any object, not just a service object.<\/p>\n<pre class=\"lang:batch decode:true \" >\r\nPS S:\\> new-object psobject -Property @{Name=\"wuauserv\";Date=Get-date;computername=$env:computername} | get-service\r\n\r\nStatus   Name               DisplayName\r\n------   ----               -----------\r\nRunning  wuauserv           Windows Update\r\n>\/pre>\r\n\r\nThis is a custom object with a name property that happens to be valid service name. If you try it with a non-valid name, you'll get an error which proves it is binding on the property name. The other properties in my New-Object example are just to have something. Let me wrap this discussion with one more example that leverages parameter binding:\r\n\r\n<pre class=\"lang:batch decode:true \" >\r\nPS C:\\work> get-content servers.txt | where {$_ -AND (Test-Connection $_ -quiet -count 2) } | Select @{Name=\"Computername\";Expression={$_.Trim()}} | get-service wuauserv | select Name,status,Machinename\r\n\r\nName                                             Status MachineName\r\n----                                             ------ -----------\r\nwuauserv                                        Running CHI-DC01\r\nwuauserv                                        Running CHI-DC02\r\nwuauserv                                        Stopped CHI-FP01\r\nwuauserv                                        Running CHI-DB01\r\nwuauserv                                        Running CHI-EX01\r\n<\/pre>\n<p>This is a one line expression that leverages the pipeline and uses some helpful (I hope) techniques. The first part using Get-Content retrieves the list of computer names from the text file. Because the text file might have blank lines and some computers might be offline, each name is piped to Where-Object which will only pass on names that exist (skipping blanks) and that can be pinged. To speed things up I'm only sending 2 pings. Now the fun part. I could use ForEach-Object and pass $_ as the value for -Computername. But according to help, this parameter accepts binding by property name.<\/p>\n<pre class=\"lang:batch decode:true \" >\r\nPS S:\\> help get-service -Parameter Computername\r\n\r\n-ComputerName <string[]>\r\n    Gets the services running on the specified computers. The default is the local computer.\r\n\r\n    Type the NetBIOS name, an IP address, or a fully qualified domain name of a remote computer. To specify the local c\r\n    omputer, type the computer name, a dot (.), or \"localhost\".\r\n\r\n    This parameter does not rely on Windows PowerShell remoting. You can use the ComputerName parameter of Get-Service\r\n    even if your computer is not configured to run remote commands.\r\n\r\n    Required?                    false\r\n    Position?                    named\r\n    Default value                Localhost\r\n    Accept pipeline input?       true (ByPropertyName)\r\n    Accept wildcard characters?  false\r\n<\/pre>\n<p>So I'll take the computername value coming from Where-Object and use a hash table with Select-Object to define a new \"property\" name, called Computername. I also take the liberty of trimming off any leading or trailing spaces, just in case. Now I have an object with a property called Computername that is piped to Get-Service which binds on the computername property. The rest is merely formatting.<\/p>\n<p>Look for opportunities to bind by parameter, which means reading cmdlet help which is a good habit to have regardless.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently I responded to an email from a student seeking clarification about the difference between ByValue and ByProperty when it comes to parameter binding. This is what makes pipelined expressions work in Windows PowerShell. When you look at cmdlet help, you&#8217;ll see that some parameters accept pipeline binding, which is what you are looking for&#8230;.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","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":[60,4],"tags":[102,308,307,98,534,302],"class_list":["post-1572","post","type-post","status-publish","format-standard","hentry","category-best-practices","category-powershell","tag-get-content","tag-get-service","tag-parameter","tag-pipeline","tag-powershell","tag-select-object"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>ByValue, I Think He&#039;s Got It &#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\/1572\/byvalue-i-think-hes-got-it\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ByValue, I Think He&#039;s Got It &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Recently I responded to an email from a student seeking clarification about the difference between ByValue and ByProperty when it comes to parameter binding. This is what makes pipelined expressions work in Windows PowerShell. When you look at cmdlet help, you&#039;ll see that some parameters accept pipeline binding, which is what you are looking for....\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/1572\/byvalue-i-think-hes-got-it\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2011-08-02T12:37:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2013-08-20T15:43:06+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=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1572\\\/byvalue-i-think-hes-got-it\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1572\\\/byvalue-i-think-hes-got-it\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"ByValue, I Think He&#8217;s Got It\",\"datePublished\":\"2011-08-02T12:37:07+00:00\",\"dateModified\":\"2013-08-20T15:43:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1572\\\/byvalue-i-think-hes-got-it\\\/\"},\"wordCount\":379,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"Get-Content\",\"Get-Service\",\"parameter\",\"Pipeline\",\"PowerShell\",\"Select-Object\"],\"articleSection\":[\"Best Practices\",\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1572\\\/byvalue-i-think-hes-got-it\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1572\\\/byvalue-i-think-hes-got-it\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1572\\\/byvalue-i-think-hes-got-it\\\/\",\"name\":\"ByValue, I Think He's Got It &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2011-08-02T12:37:07+00:00\",\"dateModified\":\"2013-08-20T15:43:06+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1572\\\/byvalue-i-think-hes-got-it\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1572\\\/byvalue-i-think-hes-got-it\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1572\\\/byvalue-i-think-hes-got-it\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Best Practices\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/best-practices\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ByValue, I Think He&#8217;s Got It\"}]},{\"@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":"ByValue, I Think He's Got It &#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\/1572\/byvalue-i-think-hes-got-it\/","og_locale":"en_US","og_type":"article","og_title":"ByValue, I Think He's Got It &#8226; The Lonely Administrator","og_description":"Recently I responded to an email from a student seeking clarification about the difference between ByValue and ByProperty when it comes to parameter binding. This is what makes pipelined expressions work in Windows PowerShell. When you look at cmdlet help, you'll see that some parameters accept pipeline binding, which is what you are looking for....","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1572\/byvalue-i-think-hes-got-it\/","og_site_name":"The Lonely Administrator","article_published_time":"2011-08-02T12:37:07+00:00","article_modified_time":"2013-08-20T15:43:06+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":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1572\/byvalue-i-think-hes-got-it\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1572\/byvalue-i-think-hes-got-it\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"ByValue, I Think He&#8217;s Got It","datePublished":"2011-08-02T12:37:07+00:00","dateModified":"2013-08-20T15:43:06+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1572\/byvalue-i-think-hes-got-it\/"},"wordCount":379,"commentCount":1,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["Get-Content","Get-Service","parameter","Pipeline","PowerShell","Select-Object"],"articleSection":["Best Practices","PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/1572\/byvalue-i-think-hes-got-it\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1572\/byvalue-i-think-hes-got-it\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1572\/byvalue-i-think-hes-got-it\/","name":"ByValue, I Think He's Got It &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2011-08-02T12:37:07+00:00","dateModified":"2013-08-20T15:43:06+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1572\/byvalue-i-think-hes-got-it\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/1572\/byvalue-i-think-hes-got-it\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1572\/byvalue-i-think-hes-got-it\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Best Practices","item":"https:\/\/jdhitsolutions.com\/blog\/category\/best-practices\/"},{"@type":"ListItem","position":2,"name":"ByValue, I Think He&#8217;s Got It"}]},{"@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":7700,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7700\/active-directory-objects-and-the-powershell-pipeline\/","url_meta":{"origin":1572,"position":0},"title":"Active Directory Objects and the PowerShell Pipeline","author":"Jeffery Hicks","date":"September 28, 2020","format":false,"excerpt":"This article is something I've been meaning to write for sometime. As often as I tell people PowerShell is easy to use once you understand its core concepts, that isn't always the case.\u00a0 This is a problem my friend Gladys Kravitz brought to my attention some time ago. Like her,\u2026","rel":"","context":"In &quot;Active Directory&quot;","block_context":{"text":"Active Directory","link":"https:\/\/jdhitsolutions.com\/blog\/category\/active-directory\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/09\/Get-bits-revised-ad.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/09\/Get-bits-revised-ad.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/09\/Get-bits-revised-ad.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/09\/Get-bits-revised-ad.jpg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/09\/Get-bits-revised-ad.jpg?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":4000,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4000\/using-optimized-text-files-in-powershell\/","url_meta":{"origin":1572,"position":1},"title":"Using Optimized Text Files in PowerShell","author":"Jeffery Hicks","date":"September 8, 2014","format":false,"excerpt":"If you are like many IT Pros that I know, you often rely on text files in your PowerShell work. How many times have you used a text file of computernames with Get-Content and then piped to other PowerShell commands only to have errors. Text files are convenient, but often\u2026","rel":"","context":"In &quot;CommandLine&quot;","block_context":{"text":"CommandLine","link":"https:\/\/jdhitsolutions.com\/blog\/category\/commandline\/"},"img":{"alt_text":"document","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/09\/document.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2752,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2752\/rename-hashtable-key-revised\/","url_meta":{"origin":1572,"position":2},"title":"Rename Hashtable Key Revised","author":"Jeffery Hicks","date":"January 24, 2013","format":false,"excerpt":"Last week I posted an advanced PowerShell function to rename a hashtable key. As usual, the more I worked with it the more I realized it was missing something - namely the ability the take a pipelined object. My original version assumed you had saved the hashtable to a variable.\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"rename-hashtable-paramsets","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/rename-hashtable-paramsets-1024x319.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/rename-hashtable-paramsets-1024x319.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/rename-hashtable-paramsets-1024x319.png?resize=525%2C300 1.5x"},"classes":[]},{"id":3025,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3025\/scrub-up-powershell-content\/","url_meta":{"origin":1572,"position":3},"title":"Scrub Up PowerShell Content","author":"Jeffery Hicks","date":"May 14, 2013","format":false,"excerpt":"It is probably a safe bet to say that IT Pros store a lot of information in simple text files. There's nothing with this. Notepad is ubiquitous and text files obviously easy to use. I bet you have text files of computer names, user names, service names, directories and probably\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"scrubbrush","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/05\/scrubbrush-300x214.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":4489,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4489\/teeing-up-to-the-clipboard\/","url_meta":{"origin":1572,"position":4},"title":"Teeing Up to the Clipboard","author":"Jeffery Hicks","date":"August 12, 2015","format":false,"excerpt":"Because I spend a great part of my day creating PowerShell related content, I often need to copy command output from a PowerShell session. The quick and dirty solution is to pipe my expression to the Clip.exe command line utility. get-service | where { $_.status -eq 'running'} | clip This\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":1046,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1046\/convert-history-to-script\/","url_meta":{"origin":1572,"position":5},"title":"Convert History to Script","author":"Jeffery Hicks","date":"January 12, 2011","format":false,"excerpt":"Whenever I teach or speak about PowerShell, a recurring mantra is that there is no difference between running a PowerShell script and executing commands interactively in the shell, except that it saves you typing. You can create a PowerShell script by simply copying and pasting commands from the shell into\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":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1572","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=1572"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1572\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1572"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1572"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1572"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}