{"id":2148,"date":"2012-04-02T12:13:04","date_gmt":"2012-04-02T16:13:04","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=2148"},"modified":"2012-04-02T12:13:04","modified_gmt":"2012-04-02T16:13:04","slug":"get-cmdlet-help-url","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2148\/get-cmdlet-help-url\/","title":{"rendered":"Get Cmdlet Help URL"},"content":{"rendered":"<p>I was toying around with PowerShell help this morning and as usually happens one thing leads to another. When you run Get-Help, or use the wrapper function Help,  you are actually getting an object: MamlCommandHelpInfo. This object has properties that you are use to seeing like name and synopsis.<\/p>\n<p><code lang=\"DOS\"><br \/>\nPS C:\\> get-help get-service |  Select Name,Syntax,RelatedLinks<\/p>\n<p>Name                       syntax                     relatedLinks<br \/>\n----                       ------                     ------------<br \/>\nGet-Service                @{syntaxItem=System.Man... @{navigationLink=Syste...<br \/>\n<\/code><\/p>\n<p>As you can see, some of these properties are nested objects.<\/p>\n<p><code lang=\"DOS\"><br \/>\nPS C:\\> get-help get-service |  Select RelatedLinks | get-member<\/p>\n<p>   TypeName: Selected.System.Management.Automation.PSCustomObject<\/p>\n<p>Name         MemberType   Definition<br \/>\n----         ----------   ----------<br \/>\nEquals       Method       bool Equals(System.Object obj)<br \/>\nGetHashCode  Method       int GetHashCode()<br \/>\nGetType      Method       type GetType()<br \/>\nToString     Method       string ToString()<br \/>\nrelatedLinks NoteProperty MamlCommandHelpInfo#relatedLinks relatedLinks=@{na...<br \/>\n<\/code><\/p>\n<p>I wanted to try something with related links, specifically those links which PowerShell uses for online help.<\/p>\n<p><code lang=\"DOS\"><br \/>\nPS C:\\> get-help get-service |  Select -expandproperty RelatedLinks<\/p>\n<p>Online version: http:\/\/go.microsoft.com\/fwlink\/?LinkID=113332<br \/>\nStart-Service<br \/>\nStop-Service<br \/>\nRestart-Service<br \/>\nResume-Service<br \/>\nSuspend-Service<br \/>\nSet-Service<br \/>\nNew-Service<br \/>\n<\/code><\/p>\n<p>It is easy to forget, that these are still objects. <\/p>\n<p><code lang=\"DOS\"><br \/>\nPS C:\\> get-help get-service |  Select -expandproperty RelatedLinks  | get-member<\/p>\n<p>   TypeName: MamlCommandHelpInfo#relatedLinks<\/p>\n<p>Name           MemberType   Definition<br \/>\n----           ----------   ----------<br \/>\nEquals         Method       bool Equals(System.Object obj)<br \/>\nGetHashCode    Method       int GetHashCode()<br \/>\nGetType        Method       type GetType()<br \/>\nToString       Method       string ToString()<br \/>\nnavigationLink NoteProperty System.Management.Automation.PSObject[] navigati...<br \/>\n<\/code><\/p>\n<p>I see that these related link objects have a NavigationLink property so I'll expand it:<\/p>\n<p><code lang=\"DOS\"><br \/>\nPS C:\\> get-help get-service |  Select -expandproperty RelatedLinks  | select -e<br \/>\nxpand navigationlink<\/p>\n<p>linkText                                uri<br \/>\n--------                                ---<br \/>\nOnline version:                         http:\/\/go.microsoft.com\/fwlink\/?Link...<br \/>\nStart-Service<br \/>\nStop-Service<br \/>\nRestart-Service<br \/>\nResume-Service<br \/>\nSuspend-Service<br \/>\nSet-Service<br \/>\nNew-Service<br \/>\n<\/code><\/p>\n<p>Now we're getting somewhere. All I want is the link with a URI value.<\/p>\n<p><code lang=\"DOS\"><br \/>\nPS C:\\> get-help get-service |  Select -expandproperty RelatedLinks  | select -expandproperty navigationlink | where {$_.uri}<\/p>\n<p>linkText                                uri<br \/>\n--------                                ---<br \/>\nOnline version:                         http:\/\/go.microsoft.com\/fwlink\/?Link...<br \/>\n<\/code><\/p>\n<p>Very cool. Now that I have the basic concept down for a single cmdlet, I can modify my expression to pull this value out of the nested objects and bring it \"up\".<\/p>\n<p><code lang=\"PowerShell\"><br \/>\nGet-Help get-service |<br \/>\n Select Name,Synopsis,@{Name=\"URI\";Expression={<br \/>\n ($_.RelatedLinks | select -ExpandProperty NavigationLink | where {$_.uri}).uri}} |<br \/>\n Where {$_.URI}<br \/>\n<\/code><\/p>\n<p>I'm using a hash table to define a custom property called URI that pulls the URI property, if found \"up\". When I run this code and pipe it to Format-List to make it easier to read I get a result like this:<\/p>\n<p><code lang=\"DOS\"><br \/>\nName     : Get-Service<br \/>\nSynopsis : Gets the services on a local or remote computer.<br \/>\nURI      : http:\/\/go.microsoft.com\/fwlink\/?LinkID=113332<br \/>\n<\/code><\/p>\n<p>Beautiful. All I need to do now is modify my code to work with more cmdlets. <\/p>\n<p><code lang=\"PowerShell\"><br \/>\n Get-Command -CommandType cmdlet | Get-Help |  Select Name,Synopsis,@{Name=\"URI\";Expression={<br \/>\n ($_.RelatedLinks | select -ExpandProperty NavigationLink | where {$_.uri}).uri}} | Where {$_.URI}<br \/>\n<\/code><\/p>\n<p>This one line command will get all cmdlets in my current PowerShell session and display the cmdlet name, synopsis and help URL if found. The PowerCLI cmdlets include online help, but not all of them so when I run this command in a session with them loaded I'll only get those cmdlets with an online help link. <\/p>\n<p>What I really wanted to show here is discovering an object's details, especially if there are nested object properties. PowerShell is all about objects in the pipeline and once you get a hold of that concept you can do some amazing things with very little effort. I'll be back tomorrow to take this one more step.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was toying around with PowerShell help this morning and as usually happens one thing leads to another. When you run Get-Help, or use the wrapper function Help, you are actually getting an object: MamlCommandHelpInfo. This object has properties that you are use to seeing like name and synopsis. PS C:\\> get-help get-service | Select&#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":[4,8],"tags":[367,534,368],"class_list":["post-2148","post","type-post","status-publish","format-standard","hentry","category-powershell","category-scripting","tag-get-help","tag-powershell","tag-url"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Get Cmdlet Help URL &#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\/2148\/get-cmdlet-help-url\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Get Cmdlet Help URL &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"I was toying around with PowerShell help this morning and as usually happens one thing leads to another. When you run Get-Help, or use the wrapper function Help, you are actually getting an object: MamlCommandHelpInfo. This object has properties that you are use to seeing like name and synopsis. PS C:&gt; get-help get-service | Select...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/2148\/get-cmdlet-help-url\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2012-04-02T16:13:04+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\\\/2148\\\/get-cmdlet-help-url\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2148\\\/get-cmdlet-help-url\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Get Cmdlet Help URL\",\"datePublished\":\"2012-04-02T16:13:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2148\\\/get-cmdlet-help-url\\\/\"},\"wordCount\":329,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"Get-Help\",\"PowerShell\",\"URL\"],\"articleSection\":[\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2148\\\/get-cmdlet-help-url\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2148\\\/get-cmdlet-help-url\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2148\\\/get-cmdlet-help-url\\\/\",\"name\":\"Get Cmdlet Help URL &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2012-04-02T16:13:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2148\\\/get-cmdlet-help-url\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2148\\\/get-cmdlet-help-url\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2148\\\/get-cmdlet-help-url\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Get Cmdlet Help URL\"}]},{\"@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":"Get Cmdlet Help URL &#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\/2148\/get-cmdlet-help-url\/","og_locale":"en_US","og_type":"article","og_title":"Get Cmdlet Help URL &#8226; The Lonely Administrator","og_description":"I was toying around with PowerShell help this morning and as usually happens one thing leads to another. When you run Get-Help, or use the wrapper function Help, you are actually getting an object: MamlCommandHelpInfo. This object has properties that you are use to seeing like name and synopsis. PS C:> get-help get-service | Select...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2148\/get-cmdlet-help-url\/","og_site_name":"The Lonely Administrator","article_published_time":"2012-04-02T16:13:04+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\/2148\/get-cmdlet-help-url\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2148\/get-cmdlet-help-url\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Get Cmdlet Help URL","datePublished":"2012-04-02T16:13:04+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2148\/get-cmdlet-help-url\/"},"wordCount":329,"commentCount":1,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["Get-Help","PowerShell","URL"],"articleSection":["PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/2148\/get-cmdlet-help-url\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2148\/get-cmdlet-help-url\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2148\/get-cmdlet-help-url\/","name":"Get Cmdlet Help URL &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2012-04-02T16:13:04+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2148\/get-cmdlet-help-url\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/2148\/get-cmdlet-help-url\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2148\/get-cmdlet-help-url\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Get Cmdlet Help URL"}]},{"@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":531,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/531\/think-objectively\/","url_meta":{"origin":2148,"position":0},"title":"Think Objectively","author":"Jeffery Hicks","date":"December 14, 2009","format":false,"excerpt":"A challenge many new comers to PowerShell face, especially those arriving with a VBScript background, and one that I often talk about, is shifting gears from working with text to working with objects. Here\u2019s a good example. The Win32_OperatingSystem class returns a value for TotalVisibleMemorySize, which should be the amount\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":2009,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/2009\/using-types-with-imported-csv-data-in-powershell\/","url_meta":{"origin":2148,"position":1},"title":"Using Types with Imported CSV Data in PowerShell","author":"Jeffery Hicks","date":"January 19, 2012","format":false,"excerpt":"The Import-CSV cmdlet in PowerShell is incredibly useful. You can take any CSV file and pump objects to the pipeline. The cmdlet uses the CSV header as properties for the custom object. PS S:\\> import-csv .\\testdata.csv Date : 1\/18\/2012 6:45:30 AM Name : Data_1 Service : ALG Key : 1\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":[]},{"id":4039,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4039\/sorting-hash-tables\/","url_meta":{"origin":2148,"position":2},"title":"Sorting Hash Tables","author":"Jeffery Hicks","date":"September 22, 2014","format":false,"excerpt":"Over the weekend I received a nice comment from a reader who came across an old post of mine on turning an object into a hash table.\u00a0 He wanted to add a comment but my blog closes comments after a period of time. But I thought it was worth sharing,\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"letterjumble","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/03\/letterjumble-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1046,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1046\/convert-history-to-script\/","url_meta":{"origin":2148,"position":3},"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":[]},{"id":1962,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1962\/friday-fun-whats-my-variable\/","url_meta":{"origin":2148,"position":4},"title":"Friday Fun What&#8217;s My Variable","author":"Jeffery Hicks","date":"January 6, 2012","format":false,"excerpt":"I use scriptblocks quite a bit in my PowerShell work, often saved as variables. These are handy for commands you want to run again, but don't necessarily need to turn into permanent functions. $freec={(get-wmiobject win32_logicaldisk -filter \"deviceid='c:'\" -property Freespace).FreeSpace\/1mb} Now in PowerShell I can invoke the scriptblock. PS S:\\> &$freec\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":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/01\/get-variabletype-1-300x197.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3718,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3718\/theres-sum-thing-happening-here\/","url_meta":{"origin":2148,"position":5},"title":"There&#8217;s Sum-thing Happening Here","author":"Jeffery Hicks","date":"February 24, 2014","format":false,"excerpt":"I am one of those IT Pros who keeps close tabs on system resources. I like to know what is being used and by what. As you might imagine, a cmdlet like Get-Process, is pretty useful to me. One of the things I'm always checking is how much memory Google\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"calculator","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/02\/calculator.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2148","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=2148"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2148\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=2148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=2148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=2148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}