Treść książki

Przejdź do opcji czytnikaPrzejdź do nawigacjiPrzejdź do informacjiPrzejdź do stopki
48
Rozdział2:Korzystaniezpoleceńcmdlet
Alias
Alias
Alias
Alias
Alias
Alias
Alias
Alias
Alias
Alias
Alias
gps->Get-Process
gbp->Get-PSBreakpoint
gcs->Get-PSCallStack
gdr->Get-PSDrive
gsn->Get-PSSession
gsnp->Get-PSSnapin
gsv->Get-Service
gu->Get-Unique
gv->Get-Variable
gwmi->Get-WmiObject
group->Group-Object
5.Łatwiejszysposóbsprawdzaniaaliasuwybranegopoleceniacmdletpoleganauży-
ciuparametru-DefnitionpoleceniaGet-Aliaswnastępującysposób:
galldefinitionGet-ChildItem
6.UżyjaliasudlapoleceniacmdletGet-ChildItemiprzekierujwynikdoaliasupole-
ceniaGet-Member,jakponiżej:
gci|gm
7.AbywyświetlićtylkowłaściwościdostępnedlaobiektówzwracanychprzezGet-
ChildItemzzastosowaniemprzełącznika-Forcewceludołączeniaukrytychplików
ifolderów,użyjparametru-MemberTypezwartościąproperty(właściwość).Tym
razemwpisującpolecenieposłużsięuzupełnianiem,zamiastużywaniaaliasów,jak
poniżej:
Get-ChildItem-Force|Get-Member-membertypeproperty
Wyjścietegopoleceniajestpokazaneponiżej:
TypeName:System.IO.DirectoryInfo
Name
MemberTypeDefinition
---
-
---
---
---
----
---
---
-
Attributes
Property
System.IO.FileAttributesAttributes{get;set;}
CreationTime
Property
datetimeCreationTime{get;set;}
CreationTimeUtc
Property
datetimeCreationTimeUtc{get;set;}
Exists
Property
boolExists{get;}
Extension
Property
stringExtension{get;}
FullName
Property
stringFullName{get;}
LastAccessTime
Property
datetimeLastAccessTime{get;set;}
LastAccessTimeUtcProperty
datetimeLastAccessTimeUtc{get;set;}
LastWriteTime
LastWriteTimeUtc
Name
Property
Property
stringName{get;}
Property
datetimeLastWriteTime{get;set;}
datetimeLastWriteTimeUtc{get;set;}
Parent
Property
System.IO.DirectoryInfoParent{get;}
Root
Property
System.IO.DirectoryInfoRoot{get;}
TypeName:System.IO.FileInfo
Name
---
-
Attributes
MemberTypeDefinition
---
---
---
----
---
---
-
Property
System.IO.FileAttributesAttributes{get;set;}