Hi, I have been experimenting with powershell scripts. I have this ;
…
$i=0
$string=@"
“@
Get-Partition | Where-Object DriveLetter -Match ‘^\w$’ | ForEach-Object {
$string+=@”
…
It can see my drives, but the array is not being outputted in logical order, that is I hope to add something that will work.
This experiment is kind of specific, so I dont really know of it is possible, so the indexes are in alphabetic order.
Unfortunately your code is incomplete and you’re not describing what your actual goal is. You may share an example how you’d like your ouptput to look like.
Regardless of that - when you post code please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.