MyTetra Share
Делитесь знаниями!
Как получить всю информацию о командлете в Windows Power Shell
Время создания: 22.04.2015 14:08
Раздел: Компьютер - Windows - Windows Power Shell
Запись: xintrea/mytetra_syncro/master/base/1429700881b8lc975voc/text.html на raw.github.com

Есть некий командлет, например Test-Path. Нужно получить всю возможную информацию о нем.


Можно выполнить следующую команду:


PS C:\Windows\system32> Get-Command Test-Path


CommandType Name Definition

----------- ---- ----------

Cmdlet Test-Path Test-Path [-Path] <String[]> [-Filter <String>] ...


Это очень краткая информация, и по ней невозможно определить, например, в какой модуль входит коммандлет.


Для получения более подробной информации, надо "развернуть" все свойства, полученные в объекте, выданном коммандлетом Get-Command. Это можно сделать с помощью коммандлета Format-List (сокращенно fl), который форматирует вывод как список свойств, в котором каждое свойство выводится на новой строке:


PS C:\Windows\system32> Get-Command Test-Path | fl *

HelpUri : http://go.microsoft.com/fwlink/?LinkID=113418

DLL : C:\Windows\assembly\GAC_MSIL\Microsoft.PowerShell.Commands.Management\1.0.0.0__31bf3856ad364e35\M

icrosoft.PowerShell.Commands.Management.dll

Verb : Test

Noun : Path

HelpFile : Microsoft.PowerShell.Commands.Management.dll-Help.xml

PSSnapIn : Microsoft.PowerShell.Management

ImplementingType : Microsoft.PowerShell.Commands.TestPathCommand

Definition : Test-Path [-Path] <String[]> [-Filter <String>] [-Include <String[]>] [-Exclude <String[]>] [-Pat

hType <TestPathType>] [-IsValid] [-Credential <PSCredential>] [-Verbose] [-Debug] [-ErrorAction <

ActionPreference>] [-WarningAction <ActionPreference>] [-ErrorVariable <String>] [-WarningVariabl

e <String>] [-OutVariable <String>] [-OutBuffer <Int32>] [-UseTransaction]

Test-Path [-LiteralPath] <String[]> [-Filter <String>] [-Include <String[]>] [-Exclude <String[]>

] [-PathType <TestPathType>] [-IsValid] [-Credential <PSCredential>] [-Verbose] [-Debug] [-ErrorA

ction <ActionPreference>] [-WarningAction <ActionPreference>] [-ErrorVariable <String>] [-Warning

Variable <String>] [-OutVariable <String>] [-OutBuffer <Int32>] [-UseTransaction]


DefaultParameterSet : Path

OutputType : {System.Boolean}

Name : Test-Path

CommandType : Cmdlet

Visibility : Public

ModuleName : Microsoft.PowerShell.Management

Module :

Parameters : {[Path, System.Management.Automation.ParameterMetadata], [LiteralPath, System.Management.Automati

on.ParameterMetadata], [Filter, System.Management.Automation.ParameterMetadata], [Include, System

.Management.Automation.ParameterMetadata]...}

ParameterSets : {[-Path] <String[]> [-Filter <String>] [-Include <String[]>] [-Exclude <String[]>] [-PathType <Te

stPathType>] [-IsValid] [-Credential <PSCredential>] [-Verbose] [-Debug] [-ErrorAction <ActionPre

ference>] [-WarningAction <ActionPreference>] [-ErrorVariable <String>] [-WarningVariable <String

>] [-OutVariable <String>] [-OutBuffer <Int32>] [-UseTransaction], [-LiteralPath] <String[]> [-Fi

lter <String>] [-Include <String[]>] [-Exclude <String[]>] [-PathType <TestPathType>] [-IsValid]

[-Credential <PSCredential>] [-Verbose] [-Debug] [-ErrorAction <ActionPreference>] [-WarningActio

n <ActionPreference>] [-ErrorVariable <String>] [-WarningVariable <String>] [-OutVariable <String

>] [-OutBuffer <Int32>] [-UseTransaction]}



Так же в этом разделе:
 
MyTetra Share v.0.59
Яндекс индекс цитирования