I am beginner on powershell / Powercli trying to make a report with the fields mentioned in the title.
([vCenter] [Host] [naa (canonicalname)] [DatastoreName] [NumberOfPaths] [VENDOR] [LUN ID])
The reviewed within this great community the following discussions
I have not managed to look at more examples to make a report with the desired fields.
I found this code on this website.
worked well!!! but I would like to omit some fields that I do not need...
I have tried to comment on the lines of the unwanted fields but it stopped working and I think the "}" is not well defined but I'm not sure.
on the web you can see the original code is barely modified since I was testing and learning with it (attach).
If someone can help me or redirect me to a code that reports this information, I would greatly appreciate it
I would also like to convert it into html and the body of an email, but this is another issue
Thank you very much again I run it but it does nothing.
Taking away the complexity of the problem, I would use the fields
3-naa (canonicalname) 4-NumberOfPaths 5-DatastoreName
I have commented the code again removing fields but it indicates errors if I leave} where we have been testing but it still does nothing ..
Attach new version... not run
you were right if that works. but the csv has lost information.
Reviewing I saw that delete the variable $ Datastorename
so I tried adding it with "$ Datastore Name = Get-Datastore | Sort-Object" but I think it comes in with "$ DatastoreInfo = Get-Datastore"
and I have tried to add vCenter and make it multi vcenter to run it in more than 20 vcenters simultaneously
but I have ended it by breaking completely ha ha ha ... I think it's because of the foreach
attched new version