Absolutely. RU-vid does have some great teachers who explain way better than some $1000 paid courses. The challenge is to find them out. It's even tougher now that RU-vid has removed the dislike counts.
Hi TechThoughts. Extremely grateful for your tutorials. How would i adjust the title length in '$posts | Select-Object Title,Score | Sort-Object Score -Descending'? Some of the reddit post lengths are way too lengthy. Thank you.
You can use Format-List instead: $posts | Select-Object Title,Score | Sort-Object Score -Descending | Format-List If you have to use Format-Table, it is unfortunately pretty tricky to define custom column widths for a table: stackoverflow.com/questions/38554966/controlling-column-widths-with-format-table
while i was trying with this line $objData = $rawJSON | ConvertFrom-Json ... it is throwing below error ''Conversion from JSON failed with error: Unexpected character encountered while parsing value:
@@Techthoughts2 #retrieve dynamic content from a website $webResults = Invoke-WebRequest -Uri 'reddit.com/r/powershell.json' $rawJSON = $webResults.Content $objData = $rawJSON | ConvertFrom-Json $posts = $objData.data.children.data $posts | Select-Object Title,Score | Sort-Object Score -Descending I tried both Desktop and core edition but it returns only one object
I have verified that this code does indeed work as intended. Can you please indicate the error you are receiving? Can you clarify what you mean by only one object? You should only be receiving one object, the json payload. But, it can be drilled into to discover many sub properties containing content.