I have a script going through all Web.Lists and List.Items in given site collection. On one point i want to have a full link to the item that is being processed. I'm doing it this way:
$ItemURL = $List.ParentWeb.Url + "/" + $List.RootFolder.Url + "/dispform.aspx?id=" + $Item.Id
It works on all lists, but not on libraries due to lacking /Forms/ after library name. Any idea how can i modify it to work also on libraries? Adding "/Forms/" strictly to the line of code will break link for lists.