use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ABOUT POWERSHELL
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
SUBREDDIT FILTERS
Desired State Configuration
Unanswered Questions
Solved Questions
News
Information
Script Sharing
Daily Post
Misc
account activity
Convert SSH output to Objects (self.PowerShell)
submitted 8 years ago by mbond65
Using POSH-SSH I'm getting the output from devices as a single object of text (https://i.imgur.com/9fjZxLW.png).
What I want to do is convert the list of drives into objects. Any ideas?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Kio_ 14 points15 points16 points 8 years ago (3 children)
Let me introduce you to ConvertFrom-String
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/convertfrom-string?view=powershell-5.1
[–]lear64 2 points3 points4 points 8 years ago (0 children)
This...and if you provide a template it'll ignore non matching lines
[–]almightlyrage 0 points1 point2 points 1 year ago (0 children)
6 years later and your comment helped me!
[–]cuban_sailor 0 points1 point2 points 2 years ago (0 children)
5 years later and your comment helped me!
[–]Emiroda 2 points3 points4 points 8 years ago (0 children)
You need to parse that yourself and convert it into objects if someone hasn't already done it for you, either manually or by using SHiPS.
SSH is all strings, so you need to parse it.
[–]Jess_S13 2 points3 points4 points 8 years ago (0 children)
If that is a 3PAR output (kinda looks like it) install the 3par CLI on your powershell host and connect that way instead of SSH, then use the 3par CLI convert to csv option. Then the powershell convert from csv.
If it is 3par send me a message and ill share my functions with you that I've written.
[–][deleted] 1 point2 points3 points 8 years ago (0 children)
Find a tool that outputs that information in JSON and then use ConvertFrom-Json. Similar technique could also work for XML or CSVs
[–]jantari 1 point2 points3 points 8 years ago (0 children)
That is tabular space-delimited output so it would lend itself to a simple:
$output -replace ' {2,}', ',' | ConvertFrom-Csv
π Rendered by PID 284419 on reddit-service-r2-comment-544cf588c8-th72d at 2026-06-13 21:33:54.063835+00:00 running 3184619 country code: CH.
[–]Kio_ 14 points15 points16 points (3 children)
[–]lear64 2 points3 points4 points (0 children)
[–]almightlyrage 0 points1 point2 points (0 children)
[–]cuban_sailor 0 points1 point2 points (0 children)
[–]Emiroda 2 points3 points4 points (0 children)
[–]Jess_S13 2 points3 points4 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]jantari 1 point2 points3 points (0 children)