I am trying to something pretty simple in powershell, I have instance of ProjectItem and I would like read the value of the FileNames property (documented as a string array). However its proving to be quite difficult
ForEach ($item in $scripts.ProjectItems) {
Write-Host $item.FileNames
Write-Host $item.FileNames[0]
Write-Host $item.FileNames(0)
}
So my goal here is to move some files around a project. The output of these 3 Write-Host lines is
string FileNames (short) {get}
string FileNames (short) {get}
string FileNames (short) {get}
Is there something special I have to do to read this as an array?