aracılığıyla görüntüleyemiyorum Aşağıdaki ifadeyi çalıştırmaya çalışıyorum.PowerShell cmdlet özelliği gösterir, ancak 'select'
dir IIS:\Sites| foreach{ get-webapplication -site $_.Name} | select -first 1
Bu
Name Application pool Protocols Physical Path
---- ---------------- --------- -------------
i1 DefaultWebSite http C:\inetpub\hosts\DefaultWebSite\i1
sonuçlanır Ama sonuç sonrasında yürüttüğünüzde
dir IIS:\Sites| foreach{ get-webapplication -site $_.Name} | select -first 1 name
Yani bu nesne
dir IIS:\Sites| foreach{ get-webapplication -site $_.Name} | select -first 1 | get-member | sort
Name | select Name, MemberType | format-table -auto
Name MemberType
---- ----------
applicationPool NoteProperty
Attributes Property
ChildElements Property
ClearLocalData Method
Collection NoteProperty
ConfigurationPathType NoteProperty
Copy Method
Delete Method
ElementTagName Property
enabledProtocols NoteProperty
Equals Method
GetAttribute Method
GetAttributeValue Method
GetChildElement Method
GetCollection Method
GetHashCode Method
GetMetadata Method
GetParentElement Method
GetType Method
Item ParameterizedProperty
ItemXPath NoteProperty
LoadProperties Method
Location NoteProperty
Methods Property
path NoteProperty
PhysicalPath ScriptProperty
PSPath NoteProperty
Schema Property
SetAttributeValue Method
SetMetadata Method
ToPSObject Method
ToString Method
Update Method
UpdateCollection Method
virtualDirectoryDefaults NoteProperty
için özelliklerinde içine baktı boş Yani 'İsim' özelliği yok . Get-webpplication ad özelliğini nasıl gösterebilir, ancak bunu seçemeyiz?
İlgili soru: http://stackoverflow.com/questions/7504027/powershell- WebAdministration-ho w-to-get-website-from-webapplication – BACON