Hi,
I have following script:
#Retrieving the Web Site with List
$MyWeb = Get-SPWeb "http://MySite"
#Get the List name
$MyList = $MyWeb.Lists["MyList"]
#Get The View
#Change the name of the view
$MyView = $MyList.Views["My View"]
#Get the Items from the view
$MyItems = $MyList.GetItems($MyView)
#Get Specific field items and export it to a csv file
$MyItems | %{ select-object -input $_ -prop @{Name='ID';expression={$_.ID;}}, @{Name='Content Type';expression={$_["x. Type"];}},
@{Name='Item Name';expression={$_["Item Name"];}}, @{Name='Categories';expression={$_["Categories"];}},
@{Name='Item Activity';expression={$_["Item Activity"];}},
@{Name='attending';expression={$_["attending"];}}; } | Export-Csv -Path C:\MyExports\export.csv
Now, the categories field is a lookup field how do use substring after function for the look up field so that I get the text after "#" character?