Replies: 1 comment 2 replies
-
Did you try to just set List parameter to the list object instead of the
url?
The parameter is a pipebind, so it takes different types of objects.
Writing out url might give you a hint as well
ons. 14. dec. 2022 16.32 skrev myatix ***@***.***>:
… Hi Everyone,
I am currently running the following in an Azure Function App...
write-host -f Cyan "Logging Site information in Site Directory for"
$webUrl $Web = Get-PnPWeb -Connection $webConnect $siteDirListUrl =
$templateSiteUrl + "/Lists/" + $siteDirList write-host $siteDirListUrl
Add-PnPListItem -List $siteDirListUrl -Values @{"Title" = $Web.Title;
"URL"= $Web.URL; "Site Description"= $Web.Description } -Connection
$tplSiteConnect
When I do write-host $siteDirListUrl I get a valid URL for the list but
for some reason the Azure Function Returns the following error:
022-12-14T15:26:06Z [Error] ERROR: The specified list was not found.
Notice that the title is case sensitive.
Exception :
Type : System.Management.Automation.PSInvalidOperationException
ErrorRecord :
Exception :
Type : System.Management.Automation.ParentContainsErrorRecordException
Message : The specified list was not found. Notice that the title is case
sensitive.
HResult : -2146233087
CategoryInfo : InvalidOperation: (:) [], ParentContainsErrorRecordException
FullyQualifiedErrorId : InvalidOperation
TargetSite :
Name : ProcessRecord
DeclaringType : PnP.PowerShell.Commands.Base.PnPConnectedCmdlet
MemberType : Method
Module : PnP.PowerShell.dll
StackTrace :
at PnP.PowerShell.Commands.Base.PnPConnectedCmdlet.ProcessRecord() in
c:\build\src\Commands\Base\PnPConnectedCmdlet.cs:line 79
at PnP.PowerShell.Commands.PnPSharePointCmdlet.ProcessRecord() in
c:\build\src\Commands\Base\PnPSharePointCmdlet.cs:line 121
at System.Management.Automation.Cmdlet.DoProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
Message : The specified list was not found. Notice that the title is case
sensitive.
Source : PnP.PowerShell
HResult : -2146233079
CategoryInfo : InvalidOperation: (:) [Add-PnPListItem],
PSInvalidOperationException
FullyQualifiedErrorId :
InvalidOperation,PnP.PowerShell.Commands.Lists.AddListItem
InvocationInfo :
MyCommand : Add-PnPListItem
ScriptLineNumber : 43
OffsetInLine : 5
HistoryId : 1
ScriptName : C:\home\site\wwwroot\SPOSiteProvisioning\run.ps1
Line : Add-PnPListItem -List $siteDirListUrl -Values @{"Title" =
$Web.Title; "URL"= $Web.URL; "Site Description"= $Web.Description }
-Connection $tplSiteConnect
PositionMessage : At C:\home\site\wwwroot\SPOSiteProvisioning\run.ps1:43 char:5
+ Add-PnPListItem -List $siteDirListUrl -Values @{"Title" = $Web.Ti …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PSScriptRoot : C:\home\site\wwwroot\SPOSiteProvisioning
PSCommandPath : C:\home\site\wwwroot\SPOSiteProvisioning\run.ps1
InvocationName : Add-PnPListItem
CommandOrigin : Internal
ScriptStackTrace : at , C:\home\site\wwwroot\SPOSiteProvisioning\run.ps1:
line 43
—
Reply to this email directly, view it on GitHub
<#2651>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMTDTSLI5OUFMJJCF7KAKLWNHSAFANCNFSM6AAAAAAS6T6YAY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Everyone,
I am currently running the following in an Azure Function App...
write-host -f Cyan "Logging Site information in Site Directory for" $webUrl $Web = Get-PnPWeb -Connection $webConnect $siteDirListUrl = $templateSiteUrl + "/Lists/" + $siteDirList write-host $siteDirListUrl Add-PnPListItem -List $siteDirListUrl -Values @{"Title" = $Web.Title; "URL"= $Web.URL; "Site Description"= $Web.Description } -Connection $tplSiteConnect
When I do write-host $siteDirListUrl I get a valid URL for the list but for some reason the Azure Function Returns the following error:
022-12-14T15:26:06Z [Error] ERROR: The specified list was not found. Notice that the title is case sensitive.
Exception :
Type : System.Management.Automation.PSInvalidOperationException
ErrorRecord :
Exception :
Type : System.Management.Automation.ParentContainsErrorRecordException
Message : The specified list was not found. Notice that the title is case sensitive.
HResult : -2146233087
CategoryInfo : InvalidOperation: (:) [], ParentContainsErrorRecordException
FullyQualifiedErrorId : InvalidOperation
TargetSite :
Name : ProcessRecord
DeclaringType : PnP.PowerShell.Commands.Base.PnPConnectedCmdlet
MemberType : Method
Module : PnP.PowerShell.dll
StackTrace :
at PnP.PowerShell.Commands.Base.PnPConnectedCmdlet.ProcessRecord() in c:\build\src\Commands\Base\PnPConnectedCmdlet.cs:line 79
at PnP.PowerShell.Commands.PnPSharePointCmdlet.ProcessRecord() in c:\build\src\Commands\Base\PnPSharePointCmdlet.cs:line 121
at System.Management.Automation.Cmdlet.DoProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
Message : The specified list was not found. Notice that the title is case sensitive.
Source : PnP.PowerShell
HResult : -2146233079
CategoryInfo : InvalidOperation: (:) [Add-PnPListItem], PSInvalidOperationException
FullyQualifiedErrorId : InvalidOperation,PnP.PowerShell.Commands.Lists.AddListItem
InvocationInfo :
MyCommand : Add-PnPListItem
ScriptLineNumber : 43
OffsetInLine : 5
HistoryId : 1
ScriptName : C:\home\site\wwwroot\SPOSiteProvisioning\run.ps1
Line : Add-PnPListItem -List $siteDirListUrl -Values @{"Title" = $Web.Title; "URL"= $Web.URL; "Site Description"= $Web.Description } -Connection $tplSiteConnect
ScriptStackTrace : at , C:\home\site\wwwroot\SPOSiteProvisioning\run.ps1: line 43
Beta Was this translation helpful? Give feedback.
All reactions