{"id":7604,"date":"2020-07-22T11:25:22","date_gmt":"2020-07-22T15:25:22","guid":{"rendered":"https:\/\/jdhitsolutions.com\/blog\/?p=7604"},"modified":"2020-09-30T17:03:33","modified_gmt":"2020-09-30T21:03:33","slug":"discovering-provider-specific-commands","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7604\/discovering-provider-specific-commands\/","title":{"rendered":"Discovering Provider Specific Commands"},"content":{"rendered":"\n<p>I've been diving into PowerShell help lately while preparing my next Pluralsight course. One of the sad things I have discovered is the loss of provider-aware help. As you may know, some commands have parameters that only exist when using a specific PSDrive.\u00a0 For example, the -File parameter for <strong>Get-ChildItem <\/strong>only works in the file system. If you change to the CERT: PSDrive that parameter isn't available. But you do get a new parameter like -CodeSigningCert. It used to be that you could use help to discover these differences. <strong>Get-Help<\/strong> has a -Path parameter to assist you.<\/p>\n\n\n\n<p>Sadly, at least for me as a PowerShell teacher, this no longer works, especially if you have updated help recently in Windows PowerShell. Microsoft is working on some updates to how Help is delivered but for now we might need alternatives.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Get-Command<\/h2>\n\n\n\n<p>One option is to use <strong>Get-Command<\/strong> and its -Syntax parameter.<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7605\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gcm-syntax-1.png\" alt=\"gcm-syntax-1\" width=\"975\" height=\"205\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gcm-syntax-1.png 975w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gcm-syntax-1-300x63.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gcm-syntax-1-768x161.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gcm-syntax-1-850x179.png 850w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/>This is the syntax you are used to seeing. But watch what happens when I change location.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"974\" height=\"334\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gcm-syntax-2.png\" alt=\"gcm-syntax-2\" class=\"wp-image-7606\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gcm-syntax-2.png 974w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gcm-syntax-2-300x103.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gcm-syntax-2-768x263.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gcm-syntax-2-850x291.png 850w\" sizes=\"auto, (max-width: 974px) 100vw, 974px\" \/><\/figure>\n\n\n\n<p>This is in Windows PowerShell, by the way. As you can see there are different parameters I can use when in the CERT: PSDrive.<\/p>\n\n\n\n<p>Unfortunately, this isn't an easy thing to discover. So I created a copy of <strong>Get-Command<\/strong> using the <a href=\"http:\/\/bit.ly\/31Ty8Sm\" target=\"_blank\" rel=\"noopener noreferrer\">Copy-Command<\/a> function from the PSScriptTools module.\u00a0 My version is essentially the same command with the addition of a Path parameter. This paremeter works the same was as it did in <strong>Get-Help<\/strong>. It shows you the result based on the path your specify.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"961\" height=\"457\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gcm2.png\" alt=\"gcm2\" class=\"wp-image-7607\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gcm2.png 961w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gcm2-300x143.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gcm2-768x365.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gcm2-850x404.png 850w\" sizes=\"auto, (max-width: 961px) 100vw, 961px\" \/><\/figure>\n\n\n\n<p>The path parameter uses an autocompleter for the first PSDrive in each PSProvider. Here's the function, complete with copied help.<\/p>\n\n\n\n<pre class=\"wp-block-code lang:ps mark:0 decode:true\"><code lang=\"powershell\" class=\"language-powershell\">#requires -version 5.1\r\n\r\r\n&lt;#\r\nThis is a copy of:\r\n\r\nCommandType Name        Version Source\r\n----------- ----        ------- ------\r\nCmdlet      Get-Command 3.0.0.0 Microsoft.PowerShell.Core\r\n\r\nCreated: 20 July 2020\r\nAuthor : Jeff\r\n\r\n#>\r\n\r\n\r\nFunction Get-Command2 {\r\n&lt;#\r\n\r\n.SYNOPSIS\r\n\r\nGets all commands.\r\n\r\n\r\n.DESCRIPTION\r\n\r\nThe Get-Command2 cmdlet gets all commands that are installed on the computer, including cmdlets, aliases, functions, filters, scripts, and applications. Get-Command gets the commands from PowerShell modules and commands that were imported from other sessions. To get only commands that have been imported into the current session, use the ListImported parameter.\r\n\r\nWithout parameters, Get-Command2 gets all of the cmdlets, functions, and aliases installed on the computer. ` *` gets all types of commands, including all of the non-PowerShell files in the Path environment variable (`$env:Path`), which it lists in the Application command type.\r\n\r\nGet-Command2 that uses the exact name of the command, without wildcard characters, automatically imports the module that contains the command so that you can use the command immediately. To enable, disable, and configure automatic importing of modules, use the `$PSModuleAutoLoadingPreference` preference variable. For more information, see about_Preference_Variables (About\/about_Preference_Variables.md).\r\n\r\nGet-Command2 gets its data directly from the command code, unlike `Get-Help`, which gets its information from help topics.\r\n\r\nStarting in Windows PowerShell 5.0, results of the Get-Command2 cmdlet display a Version column by default. A new Version property has been added to the CommandInfo class.\r\n\r\n.PARAMETER Path\r\n\r\nDisplay the command using an alternate path to discover provider-aware parameters or syntax.\r\n\r\n.PARAMETER All\r\n\r\nIndicates that this cmdlet gets all commands, including commands of the same type that have the same name. By default, Get-Command gets only the commands that run when you type the command name.\r\n\r\nFor more information about the method that PowerShell uses to select the command to run when multiple commands have the same name, see about_Command_Precedence (About\/about_Command_Precedence.md). For information about module-qualified command names and running commands that do not run by default because of a name conflict, see about_Modules (About\/about_Modules.md).\r\n\r\nThis parameter was introduced in Windows PowerShell 3.0.\r\n\r\nIn Windows PowerShell 2.0, Get-Command gets all commands by default.\r\n\r\n.PARAMETER ArgumentList\r\n\r\nSpecifies an array of arguments. This cmdlet gets information about a cmdlet or function when it is used with the specified parameters (\"arguments\"). The alias for ArgumentList is Args .\r\n\r\nTo detect dynamic parameters that are available only when certain other parameters are used, set the value of ArgumentList to the parameters that trigger the dynamic parameters.\r\n\r\nTo detect the dynamic parameters that a provider adds to a cmdlet, set the value of the ArgumentList parameter to a path in the provider drive, such as WSMan:, HKLM:, or Cert:. When the command is a PowerShell provider cmdlet, enter only one path in each command. The provider cmdlets return only the dynamic parameters for the first path the value of ArgumentList . For information about the provider cmdlets, see about_Providers (About\/about_Providers.md).\r\n\r\n.PARAMETER CommandType\r\n\r\nSpecifies the types of commands that this cmdlet gets. Enter one or more command types. Use CommandType or its alias, Type . By default, Get-Command gets all cmdlets, functions, and aliases.\r\n\r\nThe acceptable values for this parameter are:\r\n\r\n- Alias. Gets the aliases of all PowerShell commands. For more information, see about_Aliases (About\/about_Aliases.md). - All. Gets all command types. This parameter value is the equivalent of ` *`.\r\n\r\n- Application. Gets non-PowerShell files in paths listed in the Path environment   variable ($env:path), including .txt, .exe, and .dll files. For more information about the Path environment variable, see about_Environment_Variables. - Cmdlet. Gets all cmdlets.\r\n\r\n- ExternalScript. Gets all .ps1 files in the paths listed in the Path environment variable   ($env:path). - Filter and Function. Gets all PowerShell advanced and simple functions and filters.\r\n\r\n- Script. Gets all script blocks. To get PowerShell scripts (.ps1 files), use the ExternalScript\r\n\r\nvalue. - Workflow. Gets all workflows. For more information about workflows, see Introducing Windows PowerShell Workflow.\r\n\r\n.PARAMETER FullyQualifiedModule\r\n\r\nSpecifies modules with names that are specified in the form of ModuleSpecification objects, described in the Remarks section of ModuleSpecification Constructor (Hashtable) (\/dotnet\/api\/microsoft.powershell.commands.modulespecification.-ctor?view=powershellsdk-1.1.0#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_). For example, the FullyQualifiedModule parameter accepts a module name that is specified in one of the following formats:\r\n\r\n- `@{ModuleName = \"modulename\"; ModuleVersion = \"version_number\"}`\r\n\r\n- `@{ModuleName = \"modulename\"; ModuleVersion = \"version_number\"; Guid = \"GUID\"}` ModuleName and ModuleVersion are required, but Guid is optional.\r\n\r\nYou cannot specify the FullyQualifiedModule parameter in the same command as a Module parameter. The two parameters are mutually exclusive.\r\n\r\n.PARAMETER ListImported\r\n\r\nIndicates that this cmdlet gets only commands in the current session.\r\n\r\nStarting in PowerShell 3.0, by default, Get-Command gets all installed commands, including, but not limited to, the commands in the current session. In PowerShell 2.0, it gets only commands in the current session.\r\n\r\nThis parameter was introduced in Windows PowerShell 3.0.\r\n\r\n.PARAMETER Module\r\n\r\nSpecifies an array of modules. This cmdlet gets the commands that came from the specified modules or snap-ins. Enter the names of modules or snap-ins.\r\n\r\nThis parameter takes string values, but the value of this parameter can also be a PSModuleInfo or PSSnapinInfo object, such as the objects that the `Get-Module`, `Get-PSSnapin`, and `Import-PSSession` cmdlets return.\r\n\r\nYou can refer to this parameter by its name, Module , or by its alias, PSSnapin . The parameter name that you choose has no effect on the command output.\r\n\r\n.PARAMETER Name\r\n\r\nSpecifies an array of names. This cmdlet gets only commands that have the specified name. Enter a name or name pattern. Wildcard characters are permitted.\r\n\r\nTo get commands that have the same name, use the All parameter. When two commands have the same name, by default, Get-Command gets the command that runs when you type the command name.\r\n\r\n.PARAMETER Noun\r\n\r\nSpecifies an array of command nouns. This cmdlet gets commands, which include cmdlets, functions, and aliases, that have names that include the specified noun. Enter one or more nouns or noun patterns. Wildcard characters are permitted.\r\n\r\n.PARAMETER ParameterName\r\n\r\nSpecifies an array of parameter names. This cmdlet gets commands in the session that have the specified parameters. Enter parameter names or parameter aliases. Wildcard characters are supported.\r\n\r\nThe ParameterName and ParameterType parameters search only commands in the current session.\r\n\r\nThis parameter was introduced in Windows PowerShell 3.0.\r\n\r\n.PARAMETER ParameterType\r\n\r\nSpecifies an array of parameter names. This cmdlet gets commands in the session that have parameters of the specified type. Enter the full name or partial name of a parameter type. Wildcard characters are supported.\r\n\r\nThe ParameterName and ParameterType parameters search only commands in the current session.\r\n\r\nThis parameter was introduced in Windows PowerShell 3.0.\r\n\r\n.PARAMETER ShowCommandInfo\r\n\r\nIndicates that this cmdlet displays command information.\r\n\r\nThis parameter was introduced in Windows PowerShell 5.0.\r\n\r\n.PARAMETER Syntax\r\n\r\nIndicates that this cmdlet gets only the following specified data about the command:\r\n\r\n- Aliases. Gets the standard name.\r\n\r\n- Cmdlets. Gets the syntax.\r\n\r\n- Functions and filters. Gets the function definition.\r\n\r\n- Scripts and applications or files. Gets the path and filename.\r\n\r\n.PARAMETER TotalCount\r\n\r\nSpecifies the number of commands to get. You can use this parameter to limit the output of a command.\r\n\r\n.PARAMETER Verb\r\n\r\nSpecifies an array of command verbs. This cmdlet gets commands, which include cmdlets, functions, and aliases, that have names that include the specified verb. Enter one or more verbs or verb patterns. Wildcard characters are permitted.\r\n\r\n\r\n.EXAMPLE\r\n\r\nGet-Command2\r\n\r\n\r\n.EXAMPLE\r\n\r\n Get-Command2-ListImported\r\n\r\n\r\n.EXAMPLE\r\n\r\nGet-Command2 -Type Cmdlet | Sort-Object -Property Noun | Format-Table -GroupBy Noun\r\n\r\n\r\n.EXAMPLE\r\n\r\nGet-Command2 -Module Microsoft.PowerShell.Security, Microsoft.PowerShell.Utility\r\n\r\n\r\n.EXAMPLE\r\n\r\nGet-Command2 Get-AppLockerPolicy\r\nWhen a module is imported automatically, the effect is the same as using the Import-Module cmdlet. The module can add commands, types and formatting files, and run scripts in the session. To enable, disable, and configuration automatic importing of modules, use the `$PSModuleAutoLoadingPreference` preference variable. For more information, see about_Preference_Variables (..\/Microsoft.PowerShell.Core\/About\/about_Preference_Variables.md).\r\n\r\n.EXAMPLE\r\n\r\n Get-Childitem -Args Cert: -Syntax\r\nWhen you compare the syntax displayed in the output with the syntax that is displayed when you omit the Args ( ArgumentList ) parameter, you'll see that the Certificate provider adds a dynamic parameter, CodeSigningCert , to the `Get-ChildItem` cmdlet.\r\nFor more information about the Certificate provider, see about_Certificate_Provider (..\/Microsoft.PowerShell.Security\/About\/about_Certificate_Provider.md).\r\n\r\n.EXAMPLE\r\n\r\nfunction Get-DynamicParameters\r\n{\r\n    param ($Cmdlet, $PSDrive)\r\n    ( $Cmdlet -ArgumentList $PSDrive).ParameterSets | ForEach-Object {$_.Parameters} | Where-Object { $_.IsDynamic } | Select-Object -Property Name -Unique\r\n}\r\nGet-DynamicParameters -Cmdlet Get-ChildItem -PSDrive Cert:\r\n\r\nName\r\n----\r\nCodeSigningCert\r\nThe `Get-DynamicParameters` function in this example gets the dynamic parameters of a cmdlet. This is an alternative to the method used in the previous example. Dynamic parameter can be added to a cmdlet by another cmdlet or a provider.\r\n\r\n.EXAMPLE\r\n\r\n Get-Command2 *\r\nIt returns an ApplicationInfo object (System.Management.Automation.ApplicationInfo) for each file, not a FileInfo object (System.IO.FileInfo).\r\n\r\n.EXAMPLE\r\n\r\n Get-Command2 -ParameterName *Auth* -ParameterType AuthenticationMechanism\r\nYou can use a command like this one to find cmdlets that let you specify the method that is used to authenticate the user.\r\nThe ParameterType parameter distinguishes parameters that take an AuthenticationMechanism value from those that take an AuthenticationLevel parameter, even when they have similar names.\r\n\r\n.EXAMPLE\r\n\r\n dir\r\n\r\nCommandType     Name                                               ModuleName\r\n-----------     ----                                               ----------\r\nAlias           dir -> Get-ChildItem\r\nAlthough it is typically used on cmdlets and functions, Get-Command also gets scripts, functions, aliases, and executable files.\r\nThe output of the command shows the special view of the Name property value for aliases. The view shows the alias and the full command name.\r\n\r\n.EXAMPLE\r\n\r\n Notepad -All | Format-Table CommandType, Name, Definition\r\n\r\nCommandType     Name           Definition\r\n-----------     ----           ----------\r\nApplication     notepad.exe    C:\\WINDOWS\\system32\\notepad.exe\r\nApplication     NOTEPAD.EXE    C:\\WINDOWS\\NOTEPAD.EXE\r\nThe All parameter is useful when there is more than one command with the same name in the session.\r\nBeginning in Windows PowerShell 3.0, by default, when the session includes multiple commands with the same name, Get-Command gets only the command that runs when you type the command name. With the All parameter, Get-Command gets all commands with the specified name and returns them in execution precedence order. To run a command other than the first one in the list, type the fully qualified path to the command.\r\nFor more information about command precedence, see about_Command_Precedence (About\/about_Command_Precedence.md).\r\n\r\n.EXAMPLE\r\n\r\n( Get-Date).ModuleName\r\n\r\nMicrosoft.PowerShell.Utility\r\nThis command format works on commands in PowerShell modules, even if they are not imported into the session.\r\n\r\n.EXAMPLE\r\n\r\nGet-Command2 -Type Cmdlet | Where-Object OutputType | Format-List -Property Name, OutputType\r\nThis command gets the cmdlets and functions that have an output type and the type of objects that they return.\r\nThe first part of the command gets all cmdlets. A pipeline operator (|) sends the cmdlets to the `Where-Object` cmdlet, which selects only the ones in which the OutputType property is populated. Another pipeline operator sends the selected cmdlet objects to the `Format-List` cmdlet, which displays the name and output type of each cmdlet in a list.\r\nThe OutputType property of a CommandInfo object has a non-null value only when the cmdlet code defines the OutputType attribute for the cmdlet.\r\n\r\n.EXAMPLE\r\n\r\nGet-Command2 -ParameterType (((Get-NetAdapter)[0]).PSTypeNames)\r\n\r\nCommandType     Name                                               ModuleName\r\n-----------     ----                                               ----------\r\nFunction        Disable-NetAdapter                                 NetAdapter\r\nFunction        Enable-NetAdapter                                  NetAdapter\r\nFunction        Rename-NetAdapter                                  NetAdapter\r\nFunction        Restart-NetAdapter                                 NetAdapter\r\nFunction        Set-NetAdapter                                     NetAdapter\r\nThis command finds cmdlets that take net adapter objects as input. You can use this command format to find the cmdlets that accept the type of objects that any command returns.\r\nThe command uses the PSTypeNames intrinsic property of all objects, which gets the types that describe the object. To get the PSTypeNames property of a net adapter, and not the PSTypeNames property of a collection of net adapters, the command uses array notation to get the first net adapter that the cmdlet returns. To get the PSTypeNames property of a net adapter, and not the PSTypeNames property of a collection of net adapters, the command uses array notation to get the first net adapter that the cmdlet returns.\r\n\r\n.NOTES\r\n\r\n* When more than one command that has the same name is available to the session, Get-Command2 returns the command that runs when you type the command name. To get commands that have the same   name, listed in run order, use the All parameter. For more information, see about_Command_Precedence (..\/Microsoft.PowerShell.Core\/About\/about_Command_Precedence.md). * When a module is imported automatically, the effect is the same as using the `Import-Module`   cmdlet. The module can add commands, types and formatting files, and run scripts in the session.   To enable, disable, and configuration automatic importing of modules, use the   `$PSModuleAutoLoadingPreference` preference variable. For more information, see about_Preference_Variables (..\/Microsoft.PowerShell.Core\/About\/about_Preference_Variables.md).\r\n\r\n\r\n\r\n.INPUTS\r\n\r\nSystem.String\r\n\r\n.LINK\r\n\r\nhttps:\/\/docs.microsoft.com\/powershell\/module\/microsoft.powershell.core\/?view=powershell-5.1&WT.mc_id=ps-gethelp\r\n\r\n.LINK\r\n\r\nOnline Version:\r\n\r\n.LINK\r\n\r\nExport-PSSession\r\n\r\n.LINK\r\n\r\nGet-Help\r\n\r\n.LINK\r\n\r\nGet-Member\r\n\r\n.LINK\r\n\r\nGet-PSDrive\r\n\r\n.LINK\r\n\r\nImport-PSSession\r\n\r\n.LINK\r\n\r\nabout_Command_Precedence\r\n\r\n#>\r\n    [CmdletBinding(DefaultParameterSetName = 'CmdletSet')]\r\n    [alias(\"gcm2\")]\r\n    Param(\r\n\r\n        [Parameter(ParameterSetName = 'CmdletSet', ValueFromPipelineByPropertyName = $true)]\r\n        [string[]]$Noun,\r\n\r\n        [Parameter(ParameterSetName = 'AllCommandSet', Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]\r\n        [ValidateNotNullOrEmpty()]\r\n        [string[]]$Name,\r\n\r\n        [Parameter(ParameterSetName = 'CmdletSet', ValueFromPipelineByPropertyName = $true)]\r\n        [string[]]$Verb,\r\n\r\n        [Parameter(ValueFromPipelineByPropertyName = $true)]\r\n        [Alias('PSSnapin')]\r\n        [string[]]$Module,\r\n\r\n        [Parameter(ValueFromPipelineByPropertyName = $true)]\r\n        [Microsoft.PowerShell.Commands.ModuleSpecification[]]$FullyQualifiedModule,\r\n\r\n        [Parameter(ParameterSetName = 'AllCommandSet', ValueFromPipelineByPropertyName = $true)]\r\n        [Alias('Type')]\r\n        [System.Management.Automation.CommandTypes]$CommandType,\r\n\r\n        [Parameter(ValueFromPipelineByPropertyName = $true)]\r\n        [int]$TotalCount,\r\n\r\n        [Parameter(ValueFromPipelineByPropertyName = $true)]\r\n        [switch]$Syntax,\r\n\r\n        [switch]$ShowCommandInfo,\r\n\r\n        [Parameter(Position = 1, ValueFromRemainingArguments = $true)]\r\n        [Alias('Args')]\r\n        [AllowEmptyCollection()]\r\n        [AllowNull()]\r\n        [System.Object[]]$ArgumentList,\r\n\r\n        [Parameter(ValueFromPipelineByPropertyName = $true)]\r\n        [switch]$All,\r\n\r\n        [Parameter(ValueFromPipelineByPropertyName = $true)]\r\n        [switch]$ListImported,\r\n\r\n        [ValidateNotNullOrEmpty()]\r\n        [string[]]$ParameterName,\r\n\r\n        [ValidateNotNullOrEmpty()]\r\n        [System.Management.Automation.PSTypeName[]]$ParameterType,\r\n\r\n        [Parameter(HelpMessage = \"Display the command using an alternate path to discover provider-aware parameters or syntax.\")]\r\n        [ArgumentCompleter( {(Get-PSProvider).foreach( {\"$($_.drives[0].name):\\\"})})]\r\n        [ValidateScript( {Test-Path $_})]\r\n        [string]$Path\r\n    )\r\n\r\n    Begin {\r\n\r\n        Write-Verbose \"[BEGIN  ] Starting $($MyInvocation.Mycommand)\"\r\n        Write-Verbose \"[BEGIN  ] Using parameter set $($PSCmdlet.ParameterSetName)\"\r\n\r\n        if ($PSBoundParameters.ContainsKey(\"Path\")) {\r\n            Write-Verbose \"[BEGIN  ] Getting command using path $Path\"\r\n            [void]$PSBoundParameters.Remove(\"Path\")\r\n            $locationChange = $True\r\n            Push-Location\r\n            Set-Location -Path $Path\r\n        }\r\n\r\n    } #begin\r\n\r\n    Process {\r\n\r\n        Write-Verbose \"[PROCESS] Invoking 'Microsoft.PowerShell.Core\\Get-Command'\"\r\n        if ($locationChange) {\r\n            Write-Verbose \"[PROCESS] Current location is $(Get-Location)\"\r\n        }\r\n        Write-Verbose ($PSBoundParameters | Out-String)\r\n        Microsoft.PowerShell.Core\\Get-Command @PSBoundParameters\r\n\r\n    } #process\r\n\r\n    End {\r\n\r\n        #set location back\r\n        if ($locationChange) {\r\n            Write-Verbose \"[END    ] Restoring original location\"\r\n            Pop-Location\r\n        }\r\n\r\n        Write-Verbose \"[END    ] Ending $($MyInvocation.Mycommand)\"\r\n\r\n    } #end\r\n\r\n} #end function\r\r<\/code><\/pre>\n\n\n\n<p>For my purposes, the new Path parameter only makes sense when using -Syntax or -ShowInfo.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Get-CommandSyntax<\/h2>\n\n\n\n<p>After working up this function, I realized I could go down a different path. Especially if all I cared about was the syntax. What I really wanted was a way to look at a command across all providers and see how the syntax changes. That\u2019s the purpose behind Get-CommandSyntax which has an alias of <em>gsyn<\/em>. The function is designed to be run from a PowerShell console. It won\u2019t work properly in the PowerShell ISE.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">Function Get-CommandSyntax {\r\n    [cmdletbinding()]\r\n    [alias(\"gsyn\")]\r\n    Param(\r\n        [Parameter(Position = 0, Mandatory, HelpMessage = \"Enter the name of a PowerShell cmdlet or function\")]\r\n        [ValidateScript( {Get-Command -Name $_})]\r\n        [string]$Name\r\n    )\r\n\r\n    foreach ($provider in (Get-PSProvider)) {\r\n        Write-Verbose \"Testing in $($provider.name)\"\r\n        \"$([char]0x1b)[1;4;38;5;155m$($provider.name)$([char]0x1b)[0m\"\r\n        #get first drive\r\n        $path = \"$($provider.drives[0]):\\\"\r\n        Write-Verbose \"Get syntax\"\r\n        Push-Location\r\n        Set-Location $path\r\n        $syn = Get-Command -name $Name -Syntax | Out-String\r\n\r\n        Write-Verbose \"Get dynamic parameters\"\r\n        $get = Get-Command -name $name\r\n\r\n        $dynamic = ($get.parameters.GetEnumerator() | Where-Object {$_.value.IsDynamic}).key\r\n        Pop-Location\r\n        if ($dynamic) {\r\n            Write-Verbose \"Found $($dynamic.count) dynamic parameters\"\r\n            Write-Verbose ($dynamic -join \",\")\r\n            foreach ($param in $dynamic) {\r\n                $syn = $syn -replace \"\\b$param\\b\", \"$([char]0x1b)[1;38;5;213m$param$([char]0x1b)[0m\"\r\n            }\r\n        }\r\n        $syn\r\n    } #foreach Provider\r\n\r\n}<\/code><\/pre>\n\n\n\n<p>To run the command, all you need to specify is the name of a PowerShell cmdlet or function. The command will loop through the first PSDrive for each installed PSProvider and get the command syntax. But it goes a step further.<\/p>\n\n\n\n<p>Provider-specific parameters should be dynamic. For each provider, I find the dynamic parameter names and then replace them in the syntax output with an ANSI-colored equivalent.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"939\" height=\"787\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gsyn-1.png\" alt=\"gsyn-1\" class=\"wp-image-7609\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gsyn-1.png 939w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gsyn-1-300x251.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gsyn-1-768x644.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gsyn-1-850x712.png 850w\" sizes=\"auto, (max-width: 939px) 100vw, 939px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"939\" height=\"787\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gsyn-2.png\" alt=\"gsyn-2\" class=\"wp-image-7610\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gsyn-2.png 939w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gsyn-2-300x251.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gsyn-2-768x644.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gsyn-2-850x712.png 850w\" sizes=\"auto, (max-width: 939px) 100vw, 939px\" \/><\/figure>\n\n\n\n<p>Now I can see at glance how a command might be different in a PSProvider. As I said this will work in both Windows PowerShell and PowerShell 7. It is important to check because some commands changed between Windows PowerShell and PowerShell 7. Normally I tell people to read the help, but that may not always be helpful right now. Hopefully, these commands will.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been diving into PowerShell help lately while preparing my next Pluralsight course. One of the sad things I have discovered is the loss of provider-aware help. As you may know, some commands have parameters that only exist when using a specific PSDrive.\u00a0 For example, the -File parameter for Get-ChildItem only works in the file&#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 on the blog: Discovering #PowerShell Provider Specific Commands","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":[628,224,78,76,534,151],"class_list":["post-7604","post","type-post","status-publish","format-standard","hentry","category-powershell","category-scripting","tag-ansi","tag-function","tag-get-command","tag-help","tag-powershell","tag-psprovider"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Discovering Provider Specific Commands &#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\/7604\/discovering-provider-specific-commands\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Discovering Provider Specific Commands &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"I&#039;ve been diving into PowerShell help lately while preparing my next Pluralsight course. One of the sad things I have discovered is the loss of provider-aware help. As you may know, some commands have parameters that only exist when using a specific PSDrive.\u00a0 For example, the -File parameter for Get-ChildItem only works in the file...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/7604\/discovering-provider-specific-commands\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-22T15:25:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-09-30T21:03:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gcm-syntax-1.png\" \/>\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=\"15 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7604\\\/discovering-provider-specific-commands\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7604\\\/discovering-provider-specific-commands\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Discovering Provider Specific Commands\",\"datePublished\":\"2020-07-22T15:25:22+00:00\",\"dateModified\":\"2020-09-30T21:03:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7604\\\/discovering-provider-specific-commands\\\/\"},\"wordCount\":498,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7604\\\/discovering-provider-specific-commands\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/gcm-syntax-1.png\",\"keywords\":[\"ANSI\",\"Function\",\"Get-Command\",\"Help\",\"PowerShell\",\"PSProvider\"],\"articleSection\":[\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7604\\\/discovering-provider-specific-commands\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7604\\\/discovering-provider-specific-commands\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7604\\\/discovering-provider-specific-commands\\\/\",\"name\":\"Discovering Provider Specific Commands &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7604\\\/discovering-provider-specific-commands\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7604\\\/discovering-provider-specific-commands\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/gcm-syntax-1.png\",\"datePublished\":\"2020-07-22T15:25:22+00:00\",\"dateModified\":\"2020-09-30T21:03:33+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7604\\\/discovering-provider-specific-commands\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7604\\\/discovering-provider-specific-commands\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7604\\\/discovering-provider-specific-commands\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/gcm-syntax-1.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/gcm-syntax-1.png\",\"width\":975,\"height\":205},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/7604\\\/discovering-provider-specific-commands\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Discovering Provider Specific Commands\"}]},{\"@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":"Discovering Provider Specific Commands &#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\/7604\/discovering-provider-specific-commands\/","og_locale":"en_US","og_type":"article","og_title":"Discovering Provider Specific Commands &#8226; The Lonely Administrator","og_description":"I've been diving into PowerShell help lately while preparing my next Pluralsight course. One of the sad things I have discovered is the loss of provider-aware help. As you may know, some commands have parameters that only exist when using a specific PSDrive.\u00a0 For example, the -File parameter for Get-ChildItem only works in the file...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7604\/discovering-provider-specific-commands\/","og_site_name":"The Lonely Administrator","article_published_time":"2020-07-22T15:25:22+00:00","article_modified_time":"2020-09-30T21:03:33+00:00","og_image":[{"url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gcm-syntax-1.png","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":"15 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7604\/discovering-provider-specific-commands\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7604\/discovering-provider-specific-commands\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Discovering Provider Specific Commands","datePublished":"2020-07-22T15:25:22+00:00","dateModified":"2020-09-30T21:03:33+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7604\/discovering-provider-specific-commands\/"},"wordCount":498,"commentCount":3,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7604\/discovering-provider-specific-commands\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gcm-syntax-1.png","keywords":["ANSI","Function","Get-Command","Help","PowerShell","PSProvider"],"articleSection":["PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/7604\/discovering-provider-specific-commands\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7604\/discovering-provider-specific-commands\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7604\/discovering-provider-specific-commands\/","name":"Discovering Provider Specific Commands &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7604\/discovering-provider-specific-commands\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7604\/discovering-provider-specific-commands\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gcm-syntax-1.png","datePublished":"2020-07-22T15:25:22+00:00","dateModified":"2020-09-30T21:03:33+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7604\/discovering-provider-specific-commands\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/7604\/discovering-provider-specific-commands\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7604\/discovering-provider-specific-commands\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gcm-syntax-1.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/07\/gcm-syntax-1.png","width":975,"height":205},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7604\/discovering-provider-specific-commands\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Discovering Provider Specific Commands"}]},{"@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":876,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/876\/new-psdrivehere\/","url_meta":{"origin":7604,"position":0},"title":"New-PSDriveHere","author":"Jeffery Hicks","date":"August 30, 2010","format":false,"excerpt":"I spend a lot of time, as you might expect, at a PowerShell prompt. Especially when training, presenting or doing demonstrations. Very often I'm in a folder with a long path like PS C:\\users\\jeff\\Documents\\Enterprise Mgmt Webinar. That takes up a lot of screen real estate and can be distracting. What\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\/2010\/08\/npsd-70.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/08\/npsd-70.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/08\/npsd-70.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/08\/npsd-70.png?resize=700%2C400 2x"},"classes":[]},{"id":8585,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/8585\/i-need-a-psdrive-now\/","url_meta":{"origin":7604,"position":1},"title":"I Need a PSDrive Now!","author":"Jeffery Hicks","date":"September 24, 2021","format":false,"excerpt":"I hope you've been enjoying the last few posts on working with PSDrives. To round out the set, I thought I'd remind you of a command in the PSScriptTools module that I use often, especially when teaching a live class or presenting at a conference. As you've seen, I use\u2026","rel":"","context":"In &quot;Scripting&quot;","block_context":{"text":"Scripting","link":"https:\/\/jdhitsolutions.com\/blog\/category\/scripting\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/npsd-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/npsd-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/npsd-1.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/09\/npsd-1.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":2441,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2441\/fun-with-psdrive-locations\/","url_meta":{"origin":7604,"position":2},"title":"Fun with PSDrive Locations","author":"Jeffery Hicks","date":"July 10, 2012","format":false,"excerpt":"A PowerShell PSDrive is a mapping between a PowerShell provider and a resource. The majority of our work is done in a file system PSDrive that corresponds to a file system drive. Let me show you a little trick that might come in handy with a PSDrive. My \"trick\" should\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\/2012\/07\/map-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3613,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3613\/updated-powershell-script-profiler\/","url_meta":{"origin":7604,"position":3},"title":"Updated PowerShell  Script Profiler","author":"Jeffery Hicks","date":"January 15, 2014","format":false,"excerpt":"Last year I wrote a sidebar for the Scripting Guy, Ed Wilson and an update to his PowerShell Best Practices book. I wrote a script using the new parser in PowerShell 3.0 to that would analyze a script and prepare a report showing what commands it would run, necessary parameters,\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"script-profile-report","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/01\/script-profile-report.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/01\/script-profile-report.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/01\/script-profile-report.png?resize=525%2C300 1.5x"},"classes":[]},{"id":4445,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4445\/simulating-a-powershell-demo\/","url_meta":{"origin":7604,"position":4},"title":"Simulating a PowerShell Demo","author":"Jeffery Hicks","date":"July 13, 2015","format":false,"excerpt":"A number of years ago I published my version of a Start-Demo script. In my version, I can create a text file with all of the commands I want to run. It might look like this: Get-Date get-ciminstance win32_logicaldisk | select DeviceID,Size,Freespace :: get-service | where {$_.status -eq 'running'} |\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":6547,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-core\/6547\/updating-powershell-core-windows-compatibility\/","url_meta":{"origin":7604,"position":5},"title":"Updating PowerShell Core Windows Compatibility","author":"Jeffery Hicks","date":"February 26, 2019","format":false,"excerpt":"I thought I'd share a quick update on my experiences in living in a PowerShell Core world. One of the things that Microsoft is working on to make this easier is a way to access your Windows PowerShell modules that will work in PowerShell Core. It does this through commands\u2026","rel":"","context":"In &quot;PowerShell Core&quot;","block_context":{"text":"PowerShell Core","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-core\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/02\/image_thumb-17.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/02\/image_thumb-17.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/02\/image_thumb-17.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/02\/image_thumb-17.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/7604","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=7604"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/7604\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=7604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=7604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=7604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}