Iterate through every library and open pages in SharePoint

I wrote a script to open all pages in a library. This script will iterate through all pages, open each at time in a new Internet Explorer window and close that window after 60 seconds.

# For System with PnP installed
Import-Module SharePointPnPPowerShellOnline
$url = "SharePoint Site Collection"
$list = "List" # f.ex. Pages
$fileURL = $url + $list +"/"
Connect-PnPOnline -Url $url -Credentials $credentials
$listItems = Get-PnPListItem -List $list
$i = 0
foreach($item in $listItems)
{
$callURL = $fileURL + $item.FieldValues.FileLeafRef
$IE=new-object -com internetexplorer.application
$IE.navigate2($callURL)
$IE.visible=$true
$i = $i + 1
Write-Host "Site " $i " / " $listItems.Count
Start-Sleep -Seconds 60
$IE.Quit()
}

Add User to User Policy

SharePoint and PowerShell: Get all Site Collections by Template