Re: [MSH]about cmdlet's hidden parameter's question



As /\/\o\/\/ pointed out get-command can show the actual parameters that are
taking affect. The provider cmdlets like get-childitem using the
IDynamicParameters interface to allow providers a way to extend the
parameters for the cmdlet. The help for each specific provider should
detail these parameters.

To expand on /\/\o\/\/'s example.

MSH C:\temp\monad\main> get-command get-childitem c: -usage
Get-ChildItem [[-Path] <String[]>] [[-Filter] <String>] [-Include
<String[]>] [
-Exclude <String[]>] [-Recurse] [-Force] [-Verbose] [-Debug] [-ErrorAction
<Act
ionPreference>] [-ErrorVariable <String>] [-OutVariable <String>]
[-OutBuffer <
Int32>]
Get-ChildItem [[-Path] <String[]>] [[-Filter] <String>] [-Include
<String[]>] [
-Exclude <String[]>] [-Recurse] [-Force] [-Name] [-Verbose] [-Debug]
[-ErrorAct
ion <ActionPreference>] [-ErrorVariable <String>] [-OutVariable <String>]
[-Out
Buffer <Int32>]


MSH C:\temp\monad\main> get-command get-childitem cert: -usage
Get-ChildItem [[-Path] <String[]>] [[-Filter] <String>] [-Include
<String[]>] [
-Exclude <String[]>] [-Recurse] [-Force] [-Verbose] [-Debug] [-ErrorAction
<Act
ionPreference>] [-ErrorVariable <String>] [-OutVariable <String>]
[-OutBuffer <
Int32>] [-CodeSigningCert]
Get-ChildItem [[-Path] <String[]>] [[-Filter] <String>] [-Include
<String[]>] [
-Exclude <String[]>] [-Recurse] [-Force] [-Name] [-Verbose] [-Debug]
[-ErrorAct
ion <ActionPreference>] [-ErrorVariable <String>] [-OutVariable <String>]
[-Out
Buffer <Int32>] [-CodeSigningCert]

Note, that the second call passes "cert:" as the path to the get-childitem
cmdlet and you now see -CodeSigningCert as a parameter where it wasn't
available in the FileSystem provider.


--
Jeff Jones [MSFT]
Monad Development
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.



"/\/\o\/\/ [MVP]" <oMVP@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:8E0E1218-914D-489D-AB18-73B0098944A1@xxxxxxxxxxxxxxxx
It depents on the provider the command does action :

the CodeSigningCert parameter is only shown in the second example (acting
agains the cert: store)


MSH>get-command get-childitem c: | select -expand parametersets | select
parameters | fl


Parameters : {Path, Filter, Include, Exclude, Recurse, Force, Verbose,
Debug, ErrorAction, ErrorVariable, OutVariable,
OutBuffer}

Parameters : {Path, Filter, Include, Exclude, Recurse, Force, Name,
Verbose,
Debug, ErrorAction, ErrorVariable, OutVari
able, OutBuffer}



MSH>get-command get-childitem cert: | select -expand parametersets |
select
parameters | fl


Parameters : {Path, Filter, Include, Exclude, Recurse, Force, Verbose,
Debug, ErrorAction, ErrorVariable, OutVariable,
OutBuffer, CodeSigningCert}

Parameters : {Path, Filter, Include, Exclude, Recurse, Force, Name,
Verbose,
Debug, ErrorAction, ErrorVariable, OutVari
able, OutBuffer, CodeSigningCert}

gr /\/\o\/\/

"applepwc" wrote:

Hello,everyone here:
I have one problem and one suggestion.

##########
"get-help about_signing:"
I found:
dir cert:\CurrentUser\My -codesign
$cert = @(get-childitem cert:\CurrentUser\My -codesigning)[0]
##########
get-childitem have some hidden parameters?
Or "-codesign" didn't work anymore because the example is out of date?


##########

Using "get-help get-content",I can't find the "encoding" parameter.

Otherwise using the following method :
(get-command get-content).parametersets"
get-command get-content | select -expand parametersets
(get-command get-content).definition

So will the hidden parameters' usages be included in the next dropping
of
help files?
(I think implement it will helping people utilize the monad's power.)
#########



Thanks for your comment.


.



Relevant Pages

  • How do I use -Credential parameter?
    ... But when I used those cmdlet with -Credential, ... always got an error (no matter it is Filesystem provider or registry ... MakePath on the 'FileSystem' provider failed for path 'C:\'. ... The provider does not support the use of credentials. ...
    (microsoft.public.windows.server.scripting)
  • Re: How do I use -Credential parameter?
    ... FileSystem and Registry provider do not supprt Credential parameter for V1. ... But when I used those cmdlet with -Credential, ... The provider does not support the use of credentials. ...
    (microsoft.public.windows.server.scripting)
  • Re: [MSH] get-childitem - quick way to find/sort on number children
    ... > provider the returned object for a container is a DirectoryInfo object. ... child-items one level deep - no further. ... then you could tell gci how many levels you want it to recurse. ...
    (microsoft.public.windows.server.scripting)

Loading