{"id":3987,"date":"2014-09-03T09:57:38","date_gmt":"2014-09-03T13:57:38","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=3987"},"modified":"2014-09-02T15:01:22","modified_gmt":"2014-09-02T19:01:22","slug":"making-the-shell-work-for-you-revisited","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3987\/making-the-shell-work-for-you-revisited\/","title":{"rendered":"Making the Shell Work for You Revisited"},"content":{"rendered":"<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/09\/blocks.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/09\/blocks-150x150.jpg\" alt=\"blocks\" width=\"150\" height=\"150\" class=\"alignleft size-thumbnail wp-image-3988\" \/><\/a> The other day, I posted an article about <a href=\"http:\/\/jdhitsolutions.com\/blog\/2014\/09\/powershell-for-the-people-making-the-shell-work-for-you\/\" title=\"PowerShell for the People: Making the shell work for you\" target=\"_blank\">creating your own commands<\/a> to simplify your life at the PowerShell prompt. Most of the time, creating your own wrapper function for an existing PowerShell command isn't too difficult. Personally, this is the approach I usually take. But PowerShell is all about building blocks and as you have seen, you can create your own. Another option is to take an existing PowerShell command and create a proxy function.<\/p>\n<p>With a proxy function you can add or remove parameters from a given command. That's what I did with Select-Object. First, you need to get the command metadata which includes things like parameters. Once you have the metadata you can create a proxy command and take it from there.<\/p>\n<pre class=\"lang:ps decode:true \" >$metadata = New-Object System.Management.Automation.CommandMetaData (Get-Command Select-Object)\r\n[System.Management.Automation.ProxyCommand]::Create($metadata) | clip<\/pre>\n<p>I ran this command, opened a new tab in the PowerShell ISE and pasted in the new proxy command which looks like this.<\/p>\n<pre class=\"lang:ps decode:true \" >[CmdletBinding(DefaultParameterSetName='DefaultParameter', HelpUri='http:\/\/go.microsoft.com\/fwlink\/?LinkID=113387', RemotingCapability='None')]\r\nparam(\r\n    [Parameter(ValueFromPipeline=$true)]\r\n    [psobject]\r\n    ${InputObject},\r\n\r\n    [Parameter(ParameterSetName='DefaultParameter', Position=0)]\r\n    [System.Object[]]\r\n    ${Property},\r\n\r\n    [Parameter(ParameterSetName='DefaultParameter')]\r\n    [string[]]\r\n    ${ExcludeProperty},\r\n\r\n    [Parameter(ParameterSetName='DefaultParameter')]\r\n    [string]\r\n    ${ExpandProperty},\r\n\r\n    [switch]\r\n    ${Unique},\r\n\r\n    [Parameter(ParameterSetName='DefaultParameter')]\r\n    [ValidateRange(0, 2147483647)]\r\n    [int]\r\n    ${Last},\r\n\r\n    [Parameter(ParameterSetName='DefaultParameter')]\r\n    [ValidateRange(0, 2147483647)]\r\n    [int]\r\n    ${First},\r\n\r\n    [Parameter(ParameterSetName='DefaultParameter')]\r\n    [ValidateRange(0, 2147483647)]\r\n    [int]\r\n    ${Skip},\r\n\r\n    [switch]\r\n    ${Wait},\r\n\r\n    [Parameter(ParameterSetName='IndexParameter')]\r\n    [ValidateRange(0, 2147483647)]\r\n    [int[]]\r\n    ${Index})\r\n\r\nbegin\r\n{\r\n    try {\r\n        $outBuffer = $null\r\n        if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer))\r\n        {\r\n            $PSBoundParameters['OutBuffer'] = 1\r\n        }\r\n        $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand('Select-Object', [System.Management.Automation.CommandTypes]::Cmdlet)\r\n        $scriptCmd = {&amp; $wrappedCmd @PSBoundParameters }\r\n        $steppablePipeline = $scriptCmd.GetSteppablePipeline($myInvocation.CommandOrigin)\r\n        $steppablePipeline.Begin($PSCmdlet)\r\n    } catch {\r\n        throw\r\n    }\r\n}\r\n\r\nprocess\r\n{\r\n    try {\r\n        $steppablePipeline.Process($_)\r\n    } catch {\r\n        throw\r\n    }\r\n}\r\n\r\nend\r\n{\r\n    try {\r\n        $steppablePipeline.End()\r\n    } catch {\r\n        throw\r\n    }\r\n}\r\n&lt;#\r\n\r\n.ForwardHelpTargetName Select-Object\r\n.ForwardHelpCategory Cmdlet\r\n\r\n#&gt;\r\n\r\n<\/pre>\n<p>Because I knew I wanted to create my own command with my own help, I deleted the references to help and wrapped the command in a Function. In this situation, I wanted to get rid of all parameters except InputObject and Last. Everything else remains the same. What will happen is that when I run the function it will invoke the original command in a steppable pipeline. Don't worry too much about that. Here's my finished proxy function.<\/p>\n<pre class=\"lang:ps decode:true \" >#requires -version 3.0\r\n\r\n#this is a proxy function version of Select-Object\r\n\r\nFunction Select-Last {\r\n\r\n&lt;#\r\n.Synopsis\r\nSelect the last X number of objects.\r\n.Description\r\nThis is a proxy version of Select-Object designed to select the last X number of objects. \r\n.Example\r\nPS C:\\&gt; 1..1000 | select-last 5\r\n996\r\n997\r\n998\r\n999\r\n1000\r\n.Notes\r\nLast Updated: 8\/26\/2014\r\nVersion     : 0.9\r\n\r\n.Link\r\nSelect-Object\r\n\r\n#&gt;\r\n\r\n[CmdletBinding(DefaultParameterSetName='DefaultParameter', RemotingCapability='None')]\r\nparam(\r\n    [Parameter(ValueFromPipeline=$true)]\r\n    [psobject]$InputObject,\r\n\r\n    [Parameter(ParameterSetName='DefaultParameter',\r\n    Position=0,Mandatory=$True,\r\n    HelpMessage=\"How many items do you want to select?\")]\r\n    [ValidateRange(0, 2147483647)]\r\n    [int]$Last\r\n\r\n   )\r\n\r\nbegin\r\n{\r\n    try {\r\n        $outBuffer = $null\r\n        if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer))\r\n        {\r\n            $PSBoundParameters['OutBuffer'] = 1\r\n        }\r\n        $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand('Select-Object', [System.Management.Automation.CommandTypes]::Cmdlet)\r\n        $scriptCmd = {&amp; $wrappedCmd @PSBoundParameters }\r\n        $steppablePipeline = $scriptCmd.GetSteppablePipeline($myInvocation.CommandOrigin)\r\n        $steppablePipeline.Begin($PSCmdlet)\r\n    } catch {\r\n        throw\r\n    }\r\n}\r\n\r\nprocess\r\n{\r\n    try {\r\n        $steppablePipeline.Process($_)\r\n    } catch {\r\n        throw\r\n    }\r\n}\r\n\r\nend\r\n{\r\n    try {\r\n        $steppablePipeline.End()\r\n    } catch {\r\n        throw\r\n    }\r\n}\r\n\r\n} #end function\r\n\r\n<\/pre>\n<p>I made the Last parameter mandatory and positional. Now I can run a command like this:<\/p>\n<pre class=\"lang:ps decode:true \" >get-eventlog system | select-last 3<\/pre>\n<p>It would be even better if I define my Last alias to Select-Last. Performance-wise, this performs somewhere in-between my wrapper function and the original command.  Of course, I need a Select-First, so here's the proxy version for that:<\/p>\n<pre class=\"lang:ps decode:true \" >#requires -version 3.0\r\n\r\n#this is a proxy function version of Select-Object\r\n\r\nFunction Select-First {\r\n\r\n&lt;#\r\n.Synopsis\r\nSelect the first X number of objects.\r\n.Description\r\nThis is a proxy version of Select-Object designed to select the first X number of objects. \r\n.Example\r\nPS C:\\&gt; 1..1000 | select-first 5\r\n1\r\n2\r\n3\r\n4\r\n5\r\n.Notes\r\nLast Updated: 8\/26\/2014\r\nVersion     : 0.9\r\n\r\n.Link\r\nSelect-Object\r\n\r\n#&gt;\r\n\r\n[CmdletBinding(DefaultParameterSetName='DefaultParameter', RemotingCapability='None')]\r\nparam(\r\n    [Parameter(ValueFromPipeline=$true)]\r\n    [psobject]$InputObject,\r\n\r\n    [Parameter(ParameterSetName='DefaultParameter',\r\n    Position=0,Mandatory=$True,\r\n    HelpMessage=\"How many items do you want to select?\")]\r\n    [ValidateRange(0, 2147483647)]\r\n    [int]$First\r\n\r\n   )\r\n\r\nbegin\r\n{\r\n    try {\r\n        $outBuffer = $null\r\n        if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer))\r\n        {\r\n            $PSBoundParameters['OutBuffer'] = 1\r\n        }\r\n        $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand('Select-Object', [System.Management.Automation.CommandTypes]::Cmdlet)\r\n        $scriptCmd = {&amp; $wrappedCmd @PSBoundParameters }\r\n        $steppablePipeline = $scriptCmd.GetSteppablePipeline($myInvocation.CommandOrigin)\r\n        $steppablePipeline.Begin($PSCmdlet)\r\n    } catch {\r\n        throw\r\n    }\r\n}\r\n\r\nprocess\r\n{\r\n    try {\r\n        $steppablePipeline.Process($_)\r\n    } catch {\r\n        throw\r\n    }\r\n}\r\n\r\nend\r\n{\r\n    try {\r\n        $steppablePipeline.End()\r\n    } catch {\r\n        throw\r\n    }\r\n}\r\n\r\n} #end function\r\n<\/pre>\n<p>The concept of a proxy command is to give a user a stripped down version of a known PowerShell command, but in this case I'm using a proxy command as an alternative primarily so I can be lazy and create aliases. With a little work you can create a custom toolset to meet your needs at the PowerShell prompt and be as lazy, I mean efficient, as you want.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The other day, I posted an article about creating your own commands to simplify your life at the PowerShell prompt. Most of the time, creating your own wrapper function for an existing PowerShell command isn&#8217;t too difficult. Personally, this is the approach I usually take. But PowerShell is all about building blocks and as you&#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":"New from the blog: Making the Shell Work for You Revisited http:\/\/wp.me\/p1nF6U-12j #PowerShell","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,8],"tags":[534,474,540],"class_list":["post-3987","post","type-post","status-publish","format-standard","hentry","category-powershell","category-scripting","tag-powershell","tag-proxy-command","tag-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Making the Shell Work for You Revisited &#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\/3987\/making-the-shell-work-for-you-revisited\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Making the Shell Work for You Revisited &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"The other day, I posted an article about creating your own commands to simplify your life at the PowerShell prompt. Most of the time, creating your own wrapper function for an existing PowerShell command isn&#039;t too difficult. Personally, this is the approach I usually take. But PowerShell is all about building blocks and as you...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/3987\/making-the-shell-work-for-you-revisited\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2014-09-03T13:57:38+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/09\/blocks-150x150.jpg\" \/>\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=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3987\\\/making-the-shell-work-for-you-revisited\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3987\\\/making-the-shell-work-for-you-revisited\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Making the Shell Work for You Revisited\",\"datePublished\":\"2014-09-03T13:57:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3987\\\/making-the-shell-work-for-you-revisited\\\/\"},\"wordCount\":362,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3987\\\/making-the-shell-work-for-you-revisited\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/blocks-150x150.jpg\",\"keywords\":[\"PowerShell\",\"Proxy command\",\"Scripting\"],\"articleSection\":[\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3987\\\/making-the-shell-work-for-you-revisited\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3987\\\/making-the-shell-work-for-you-revisited\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3987\\\/making-the-shell-work-for-you-revisited\\\/\",\"name\":\"Making the Shell Work for You Revisited &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3987\\\/making-the-shell-work-for-you-revisited\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3987\\\/making-the-shell-work-for-you-revisited\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/blocks-150x150.jpg\",\"datePublished\":\"2014-09-03T13:57:38+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3987\\\/making-the-shell-work-for-you-revisited\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3987\\\/making-the-shell-work-for-you-revisited\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3987\\\/making-the-shell-work-for-you-revisited\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/blocks.jpg\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/blocks.jpg\",\"width\":1280,\"height\":939},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3987\\\/making-the-shell-work-for-you-revisited\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Making the Shell Work for You Revisited\"}]},{\"@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":"Making the Shell Work for You Revisited &#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\/3987\/making-the-shell-work-for-you-revisited\/","og_locale":"en_US","og_type":"article","og_title":"Making the Shell Work for You Revisited &#8226; The Lonely Administrator","og_description":"The other day, I posted an article about creating your own commands to simplify your life at the PowerShell prompt. Most of the time, creating your own wrapper function for an existing PowerShell command isn't too difficult. Personally, this is the approach I usually take. But PowerShell is all about building blocks and as you...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3987\/making-the-shell-work-for-you-revisited\/","og_site_name":"The Lonely Administrator","article_published_time":"2014-09-03T13:57:38+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/09\/blocks-150x150.jpg","type":"","width":"","height":""}],"author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3987\/making-the-shell-work-for-you-revisited\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3987\/making-the-shell-work-for-you-revisited\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Making the Shell Work for You Revisited","datePublished":"2014-09-03T13:57:38+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3987\/making-the-shell-work-for-you-revisited\/"},"wordCount":362,"commentCount":4,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3987\/making-the-shell-work-for-you-revisited\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/09\/blocks-150x150.jpg","keywords":["PowerShell","Proxy command","Scripting"],"articleSection":["PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/3987\/making-the-shell-work-for-you-revisited\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3987\/making-the-shell-work-for-you-revisited\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3987\/making-the-shell-work-for-you-revisited\/","name":"Making the Shell Work for You Revisited &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3987\/making-the-shell-work-for-you-revisited\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3987\/making-the-shell-work-for-you-revisited\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/09\/blocks-150x150.jpg","datePublished":"2014-09-03T13:57:38+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3987\/making-the-shell-work-for-you-revisited\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/3987\/making-the-shell-work-for-you-revisited\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3987\/making-the-shell-work-for-you-revisited\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/09\/blocks.jpg","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/09\/blocks.jpg","width":1280,"height":939},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3987\/making-the-shell-work-for-you-revisited\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Making the Shell Work for You Revisited"}]},{"@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":3990,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3990\/friday-fun-creating-powershell-scripts-with-powershell\/","url_meta":{"origin":3987,"position":0},"title":"Friday Fun: Creating PowerShell Scripts with PowerShell","author":"Jeffery Hicks","date":"September 5, 2014","format":false,"excerpt":"Sometimes PowerShell really does seem like magic. Especially when you can use it to handle complicated or tedious tasks, such as creating a PowerShell script. I know many an IT Pro who want to script but without having to actually write a script. Well, I'm not sure that is realistic,\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"012914_1704_CreatingCIM1.png","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/01\/012914_1704_CreatingCIM1-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":9057,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/9057\/using-powershell-your-way\/","url_meta":{"origin":3987,"position":1},"title":"Using PowerShell Your Way","author":"Jeffery Hicks","date":"June 6, 2022","format":false,"excerpt":"I've often told people that I spend my day in a PowerShell prompt. I run almost my entire day with PowerShell. I've shared many of the tools I use daily on Github. Today, I want to share another way I have PowerShell work the way I need it, with minimal\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\/06\/dl.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/06\/dl.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/06\/dl.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/06\/dl.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":4018,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4018\/more-powershell-toolmaking-fun\/","url_meta":{"origin":3987,"position":2},"title":"More PowerShell Toolmaking Fun","author":"Jeffery Hicks","date":"September 15, 2014","format":false,"excerpt":"I am having so much fun making my own PowerShell tools that I just can't stop. I've been using my Get-Commandmetadata function that I wrote about a few weeks ago. A driving force in all of this is to have a toolset that I can use efficiently from the console.\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"blacksmith","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/09\/blacksmith.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":4005,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4005\/creating-your-own-powershell-command\/","url_meta":{"origin":3987,"position":3},"title":"Creating Your Own PowerShell Command","author":"Jeffery Hicks","date":"September 10, 2014","format":false,"excerpt":"Last week, I posted a PowerShell function that you could use as an accelerator to create your own PowerShell tools. My tool takes command metadata from an existing PowerShell cmdlet and gives you the structure to create your own tool wrapped around what is in essence a proxy function. The\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"atomic powershell","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/02\/atomicps-150x150.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":6855,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-7\/6855\/powershell-scripting-for-linux-is-still-about-the-objects\/","url_meta":{"origin":3987,"position":4},"title":"PowerShell Scripting for Linux is Still About the Objects","author":"Jeffery Hicks","date":"October 8, 2019","format":false,"excerpt":"I've been trying to increase my Linux skills, especially as I begin to write PowerShell scripts and tools that can work cross-platform. One very important concept I want to make sure you don't overlook is that even when scripting for non-Windows platforms, you must still be thinking about objects. The\u2026","rel":"","context":"In &quot;PowerShell 7&quot;","block_context":{"text":"PowerShell 7","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-7\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4857,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4857\/getting-local-user-accounts-the-powershell-way\/","url_meta":{"origin":3987,"position":5},"title":"Getting Local User Accounts the PowerShell Way","author":"Jeffery Hicks","date":"February 10, 2016","format":false,"excerpt":"It seems I'm always seeing requests and problems on getting local user accounts using PowerShell.\u00a0 However, even though we are at PowerShell 5.0,\u00a0 Microsoft has never released a set of cmdlets for managing local user accounts. So many of us have resorted to creating our own tools. I now have\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/02\/image_thumb.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/02\/image_thumb.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/02\/image_thumb.png?resize=525%2C300 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3987","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=3987"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3987\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=3987"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=3987"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=3987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}