\n Hi, and welcome to the PowerShell forum! \n\n\nDon’t apologize for being a “noob” or “newbie” or “n00b.” There’s just no need – nobody will think you’re stupid, and the forums are all about asking questions. Just ask!\nUse a descriptive subject. Don't say \"Need help\" or \"PowerShell Help\", actually summarize what the problem is. It helps the rest of us keep track of which problem is which.\nDon’t post massive scripts. We’re all volunteers and we don’t have time to read all that, nor will we copy, past…\n <\/blockquote>\n<\/aside>\n\n <\/p>","upvoteCount":0,"datePublished":"2018-08-16T14:24:56.000Z","url":"https://community.spiceworks.com/t/sort-shadowcopies-by-volume/668197/2","author":{"@type":"Person","name":"Neally","url":"https://community.spiceworks.com/u/Neally"}},{"@type":"Answer","text":"
Thanks, I fixed the post now.<\/p>","upvoteCount":0,"datePublished":"2018-08-16T14:27:17.000Z","url":"https://community.spiceworks.com/t/sort-shadowcopies-by-volume/668197/3","author":{"@type":"Person","name":"austinmartinez2","url":"https://community.spiceworks.com/u/austinmartinez2"}},{"@type":"Answer","text":"
Do not have shadow copies can you try this<\/p>\n
Get-WmiObject Win32_ShadowCopy | Where-Object {$_.VolumeName -eq $shadowStorageList[$i].Volume} | \n select DeviceObject, InstallDate,Select @{n=\"VolumeName\";e={$_.$volumeList.Label}\n<\/code><\/pre>","upvoteCount":1,"datePublished":"2018-08-16T15:04:17.000Z","url":"https://community.spiceworks.com/t/sort-shadowcopies-by-volume/668197/4","author":{"@type":"Person","name":"jitensh","url":"https://community.spiceworks.com/u/jitensh"}},{"@type":"Answer","text":"Sadly, that just through me an error. I’ve been playing with it some more and I am able to have the shadowcopies separate themselves but in hard to read format, and if the list is too long, it cuts off. I am trying to get the list to display in an easy to read method. Which I am able to produce with the code above, just not separate them. So at the moment, I am torn with readability without separation, or separation without readability. This is the error I got with running your test. I have tried to use the method I used in this example to add the readable list to the code that has the copies separated, but it doesn’t format properly.<\/p>\n
[ERROR MESSAGE]<\/p>\n
At line:31 char:27<\/p>\n
\n$shadowStorageList[$i] | add-member Noteproperty shadowcopies $ob …<\/li>\n ~ \nMissing ‘=’ operator after key in hash literal. \nAt line:36 char:6<\/li>\n write-host $shadowStorageList.shadowcopies.count<\/li>\n ~ \nMissing ‘=’ operator after key in hash literal. \nAt line:36 char:6<\/li>\n write-host $shadowStorageList.shadowcopies.count<\/li>\n ~ \nThe hash literal was incomplete. \nAt line:29 char:51<\/li>\n for($i = 0; $i -lt $shadowStorageList.Count; $i++){<\/li>\n ~ \nMissing closing ‘}’ in statement block or type definition.<\/li>\n CategoryInfo : ParserError: ( <\/span>, ParentContainsErrorRecordException<\/li>\nFullyQualifiedErrorId : MissingEqualsInHashLiteral<\/li>\n<\/ul>\n[OUTPUT I’M AFTER}<\/p>\n
DeviceObject InstallDate<\/p>\n
\n\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy25 20180816100312.004022-360 \n\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy4 20180807120004.975960-360 \n\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy5 20180807160004.269317-360 \n\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy6 20180808070003.911615-360 \n\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy7 20180808120004.337998-360 \n\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy8 20180808160004.535222-360 \n\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy9 20180809003802.258154-360 \n\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy10 20180809070004.070060-360 \n\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy11 20180809120005.622604-360 \n\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy12 20180809160004.710214-360 \n\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy13 20180810070003.545046-360 \n\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy14 20180810120004.352146-360 \n\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy15 20180810160003.823910-360 \n\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy16 20180813120006.245752-360 \n\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy17 20180813160006.501994-360 \n\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy18 20180814070006.354801-360 \n\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy19 20180814120006.493219-360 \n\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy20 20180814160006.583484-360 \n\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy21 20180815070006.176014-360 \n\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy22 20180815120006.635497-360 \n\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy23 20180815160006.756178-360 \n\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy24 20180816070006.257017-360<\/p>\n
[OUTPUT I GET]<\/p>\n
ShadowCopyList : {@{DeviceObject=\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy4; InstallDate=20180807120004.975960-360}, @{DeviceObject=\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy5; \nInstallDate=20180807160004.269317-360}, @{DeviceObject=\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy6; InstallDate=20180808070003.911615-360}, \n@{DeviceObject=\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy7; InstallDate=20180808120004.337998-360}…}<\/p>","upvoteCount":0,"datePublished":"2018-08-16T15:15:05.000Z","url":"https://community.spiceworks.com/t/sort-shadowcopies-by-volume/668197/5","author":{"@type":"Person","name":"austinmartinez2","url":"https://community.spiceworks.com/u/austinmartinez2"}},{"@type":"Answer","text":"
That is a nice output. There is some other information that I want displayed that was displayed before that isn’t in that example, but I think I can use this example and expand on it. I’ll see what happens. Thanks a lot.<\/p>","upvoteCount":0,"datePublished":"2018-08-17T12:02:42.000Z","url":"https://community.spiceworks.com/t/sort-shadowcopies-by-volume/668197/7","author":{"@type":"Person","name":"austinmartinez2","url":"https://community.spiceworks.com/u/austinmartinez2"}},{"@type":"Answer","text":"\n\n
<\/div>\n
austinmartinez2:<\/div>\n
\nThat is a nice output. There is some other information that I want displayed that was displayed before that isn’t in that example, but I think I can use this example and expand on it. I’ll see what happens. Thanks a lot.<\/p>\n<\/blockquote>\n<\/aside>\n
What I understand is you want to display drive letters and Volume shadow copy creation date, what else you looking for?<\/p>","upvoteCount":0,"datePublished":"2018-08-17T12:33:01.000Z","url":"https://community.spiceworks.com/t/sort-shadowcopies-by-volume/668197/8","author":{"@type":"Person","name":"jitensh","url":"https://community.spiceworks.com/u/jitensh"}},{"@type":"Answer","text":"
That output you were able to help with is the main thing I was after. The rest of the information I was able to obtain in display along with that table. I do have this resolved now, so thanks so much. You have been a great help.<\/p>\n
@jitensh<\/a><\/p>","upvoteCount":1,"datePublished":"2018-08-17T14:23:06.000Z","url":"https://community.spiceworks.com/t/sort-shadowcopies-by-volume/668197/9","author":{"@type":"Person","name":"austinmartinez2","url":"https://community.spiceworks.com/u/austinmartinez2"}}]}}
Neally
(Neally)
August 16, 2018, 2:24pm
2
If you post code, please use the ‘Insert Code’ button. Please and thank you!
Hi, and welcome to the PowerShell forum!
Don’t apologize for being a “noob” or “newbie” or “n00b.” There’s just no need – nobody will think you’re stupid, and the forums are all about asking questions. Just ask!
Use a descriptive subject. Don't say "Need help" or "PowerShell Help", actually summarize what the problem is. It helps the rest of us keep track of which problem is which.
Don’t post massive scripts. We’re all volunteers and we don’t have time to read all that, nor will we copy, past…