title: Powershell - Why does $ENV | GET-MEMBER not work?
body: <p>I come from a C, C++, C#, python background so i'm applying this thought pattern to Powershell which i'm learning from scratch but I'm a little confused so far as at first glance it seems to be inconsistent and does not follow a fixed base class type structure for all objects so that things can be queried in a consistent manner.</p>
  
  <p>The following works fine:</p>
  
  <pre>
     $host | get-member
     $env:username
  </pre>
  
  <p>So $env is a valid object but this does not work:</p>
  
  <pre>   $env | get-member</pre>
  
  <p>These also do not work:</p>
  
  <pre>
     $env.gettype()
     dir $env
     dir $env:
  </pre>
  
  <p>but this type query on $host does so I'm assuming $host is a .net variable but $env is not?</p>
  
  <pre>   $host.gettype()</pre>
  
  <p>I found that env: also works with dir (aka get-childitem) but this colon is yet another type of notation i'm unfamiliar with and things are starting to get very confusing now. This does not seem to be a string format in this case which I have seen some google posts about so what is it? It behaves like a member selection or dictionary key specifier. If it is a member selector or dictionary key then i would expect get-member to work because it is a standard object. </p>
  
  <p>This outputs the variables and values that I wanted but I don't understand why this syntax is used. This is not DOS syntax either so what's going on here?</p>
  
  <pre>   dir env:</pre>
  
  <p>But dir $env seems to equate to dir $env:userprofile???? why?</p>
  
  <p>Therefore $host appears to be a .net object but $env or env: is something else completely different and I've no idea what object type it is in the grand scheme of things and cannot seem to query it's type with by conventional means. Initial thoughts are that it is a list object of sorts because get-childitem works with it but other than that I'm completely lost.</p>
  
  <p>I'm clearly missing something here so can someone steer me in the right direction please?</p>