I verified your code on PS5 and PS7, and confirmed that "$p" lists ParsedHtml in PS5 but not in PS7; this is why you're getting the null-valued expression error because $t is looking for $p.ParsedHtml.
The underlying .NET API of the Web Cmdlets has been changed to System.Net.Http.HttpClient. This change provides many benefits. However, this change along with a lack of interoperability with Internet Explorer have resulted in several breaking changes within Invoke-WebRequest and Invoke-RestMethod.
Invoke-WebRequest now supports basic HTML Parsing only. Invoke-WebRequest always returns aBasicHtmlWebResponseObject object. The ParsedHtml and Forms properties have been removed.