Hello everybody.
I am scripting the creation of a Sharepoint site with powershell.
I keep on getting a very frustrating error that I cannot figure out how to solve.
I know how to add headings and links to the quick launch of the space. However, when I try to create a link for a site that my current user does not have access, I receive this error:
Exception calling "AddAsLast" with "1" argument(s): "The Web application at http://server/site could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application." At C:\Users\xxxxxx\Desktop\script.ps1:610 char:28+ $heading.Children.AddAsLast <<<< ($linkNode)+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException+ FullyQualifiedErrorId : DotNetMethodException
The thing is that manually, it is possible to create the same link I don't have access to, without receiving any error. If you click it, you don't get access, that's all.
But for some reason, I cannot create a link in the quick launch via powershell to a site I don't have access.
Is there anyway to force to creation of a link and ignore the fact that the site is not accessible?
Thanks.










