Why do I have difference in output?
$f = Get-WindowsFeature
$f[1].GetType()
$f[1]
output
IsPublic IsSerial Name BaseType -------- -------- ---- -------- True True Object[] System.Array Name : ADCS-Cert-Authority DisplayName : Certification Authority Description : Certification Authority (CA) is used to issue and manage certificates. Multiple CAs can be linked to form a public key infrastructure. ...
and
$f = Get-WindowsFeature
$f[1]
output
Display Name Name Install State ------------ ---- ------------- [ ] Certification Authority ADCS-Cert-Authority Available
Also get more verbose output from $lines.GetType()
if don't remove $f[1]
.
$f = Get-WindowsFeature
$f[1]
$lines = Get-Content featuresinarray.txt | Where {$_ -notmatch '^\s+$'}
$lines.GetType()
output
Display Name Name Install State ------------ ---- ------------- [ ] Certification Authority ADCS-Cert-Authority Available Module : CommonLanguageRuntimeLibrary Assembly : mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 TypeHandle : System.RuntimeTypeHandle DeclaringMethod : BaseType : System.Array
But now if I add $f.GetType()
after $f = Get-WindowsFeature
I get short output from both $lines.GetType()
and $f.GetType()
:
True True Object[] System.Array
If I add $f.GetType()
after $lines.GetType()
then I have 2 times verbose output of Array class in ouput. So why this is happening?