All,
So i am writing a script to gather information about folders in a project, checking for Environment, Workflow etc...
i created a datatable so i can use that to create the excel file.
however i am getting the following error when adding a row to the datatable
PS C:\WINDOWS\system32> $dr = $GET_FoldersDT.NewRow()Method invocation failed because [PWPS_DAB.CommonTypes+ProjectWiseFolder] does not contain a method named 'NewRow'.At line:1 char:13+ $dr = $GET_FoldersDT.NewRow()+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : MethodNotFound
Below is the snipit of code where i am setting the datatable, and looping through the folders
$FolderReportDT = New-Object System.Data.DataTable ("Folder Report")
#Going to create the specific columns to store the work are infomration, participant count, and document count $FolderReportDT.Columns.Add("Folder Name") $FolderReportDT.Columns.Add("Folder Environment") $FolderReportDT.Columns.Add("Folder Workflow") $FolderReportDT.Columns.Add("Folder Document COUNT") $FolderReportDT.Columns.Add("Folder Creator") $FolderReportDT.Columns.Add("Folder Owner Name") $FolderReportDT.Columns.Add("Folder URN") New-PWLoginGet-PWCurrentDatasource
$StartedFrom = (Show-PWFolderBrowserDialog).FullPath
$GET_FoldersDT = New-Object System.Data.DataTable
$GET_FoldersDT = Get-PWFolders -FolderPath $StartedFrom -PopulatePathsWrite-Host "there are " $GET_FoldersDT.count " folders found"
foreach($DT_Row in $GET_FoldersDT) {
$dr = $GET_FoldersDT.NewRow()
TIA
Stephen
ARGHHHH, i was adding the row to the wrong datatable,,,, ignore this,