Note that there are some explanatory texts on larger screens.

plurals
  1. POPowerShell cmdlet shows property, but it can't display it through 'select'
    primarykey
    data
    text
    <p>I am trying to execute the following statement.</p> <pre><code>dir IIS:\Sites| foreach{ get-webapplication -site $_.Name} | select -first 1 </code></pre> <p>This results in</p> <pre><code>Name Application pool Protocols Physical Path ---- ---------------- --------- ------------- i1 DefaultWebSite http C:\inetpub\hosts\DefaultWebSite\i1 </code></pre> <p>But when I execute the following the result is empty</p> <pre><code>dir IIS:\Sites| foreach{ get-webapplication -site $_.Name} | select -first 1 name </code></pre> <p>So I looked into the properties for this object</p> <pre><code>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 </code></pre> <p>So no 'Name' property. How is it that the get-webpplication can show the name property, but we cant select it?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload