This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
1
SharePoint 2010 Management Shell - Not outputting proper data from object
Post Body
So I feel dumb but if I run
cls
$results = [System.Collections.Generic.List[object]]@()
$results.Add( [PSCustomObject]@{
Name = 'John'
Age = 42
})
$results.add( [PSCustomObject]@{
Name = 'John'
Age = 42
})
$results.Add( [PSCustomObject]@{
Name = 'Thomas'
Age = 30
})
$results | Export-CSV C:\temp\test.csv
In SharePoint 2010 Management Shell it returns:
TYPESystem.Collections.Hashtable"IsReadOnly","IsFixedSize","IsSynchronized","Keys","Values","SyncRoot","Count" "False","False","False","System.Collections.Hashtable KeyCollection","System.Collections.Hashtable ValueCollection","System.Object","2"
"False","False","False","System.Collections.Hashtable KeyCollection","System.Collections.Hashtable ValueCollection","System.Object","2" "False","False","False","System.Collections.Hashtable KeyCollection","System.Collections.Hashtable ValueCollection","System.Object","2"
But if I run the code on the same machine using the ISE I get
#TYPE System.Management.Automation.PSCustomObject
"Name","Age"
"John","42"
"John","42"
"Thomas","30"
Can someone enlighten me? Sorry, I know it is a dumb question since we are moving to 2016 but I want to know why.
Do I need to include System.Management.Automation when using it via SP2010 Management Shell?
Author
Account Strength
100%
Account Age
13 years
Verified Email
Yes
Verified Flair
No
Total Karma
26,643
Link Karma
8,214
Comment Karma
18,410
Profile updated: 1 day ago
Posts updated: 6 months ago
Subreddit
Post Details
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 4 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/PowerShell/...