Open nate1178 opened 4 years ago
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Hi @nate1178, can you give an example of the list URL you are using? The URL needs to be relative to the web (site) you are using, e.g. lists/testlist
rather than the full path. I assume if the list cannot be resolved the command fetches alerts for all lists in the site.
Hi @danielcecil If i were to use (https://SomeSite.sharepoint.com/Sites/test/Lists/AlertTest/) in the List parameter, this would return all alerts in the site. If i use (Lists/AlertTest) in the List parameter, it returns only the alerts for this list. However, the documentation states that you can use the ID, Title, or URL of the list. There is no mention in the documentation that says to use the relative list URL. Also, in examples 2 and 3 in the documentation, it only shows the list name and not the relative list URL for the list, making this documentation page a bit confusing
Hi @nate1178, in general you don't use the full URL in PnP or CSOM (the underlying library) since when you use the Connect-PnPOnline
command the context is set to the site URL, so the URL you need to use should be relative to the site you are connected to.
I agree the examples and documentation are a little confusing. You can also use Get-PnPList
to get the list and make sure it's there before running the command, for example:
$list = Get-PnPList "Lists/MyList"
if($list) {
$alerts = Get-PnPAlert -List $list -User $user
$alerts
} else {
Write-Host "List cannot be found"
}
Notice: many issues / bugs reported are actually related to the PnP Core Library which is used behind the scenes. Consider carefully where to report an issue:
Apply-SPOProvisioningTemplate
orGet-SPOProvisioningTemplate
? The issue is most likely related to the Provisioning Engine. The Provisioning engine is not located in the PowerShell repo. Please report the issue here: https://github.com/officedev/PnP-Sites-Core/issues.Reporting an Issue or Missing Feature
The docuementation states "The ID, Title or Url of the list." but if i provide it a list URL, it returns alert data for all alerts on the site and not just from the list URL that is provided.
Expected behavior
The output expected would be the alerts that users have set on the list based off of the list URL passed in to the cmdlet
Actual behavior
The cmdlet returns all alerts that have been configured on all lists within the site
Steps to reproduce behavior
Please include complete code samples in-line or linked from gists $User = Get-PnPUser -Identity "Some Users Login Name" $Alerts = Get-PnPAlert -List "URL to some list" -User $User $Alerts
Which version of the PnP-PowerShell Cmdlets are you using?
What is the version of the Cmdlet module you are running?
3.13.19... 3.8.1904.0 3.7.1903.0
How did you install the PnP-PowerShell Cmdlets?