Would you be able to help me along? I've change the code based off of your recommendations and here's the new version. I am trying to send all of the lists to the test function. I'd like to only have to update the $url and then let the script know what to do.
[string]$url = "http://sp/Dashboard"
[string]$Field = "ProjectID"
[string]$Item = "3"
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
function FindLists() {
$site = New-Object Microsoft.SharePoint.SPSite($url)
$Lists = $site.OpenWeb().Lists.Title
echo $Lists
#foreach-object { test $Lists }
$site.Dispose()
}
function test([string]$list) {
write-host -url $url -List $list -Item $Item -Field $Field
}
FindLists
I was doing $Lists = $site.OpenWeb().Lists but that returns a whole bunch of xml that I don't know how to filter. I feel I'm close though, do you know how to tweak this to get this working?