Giter VIP home page Giter VIP logo

Comments (6)

erwinvanhunen avatar erwinvanhunen commented on May 28, 2024

Hi Roman,

Please include the code of your script straight after the New-SPOWeb cmdlet. I assume you're doing something like

$web = new-spoweb

and then you use the $web object?

Because it's using CSOM, not all properties of the web object are loaded by default ,e.g. you might have to request them specifically

for instance:

$ctx = Get-SPOContext
$list = web.Lists.GetByTitle("Test")
$ctx.Load($list)
$ctx.ExecuteQuery()

from pnp-powershell.

maerger avatar maerger commented on May 28, 2024

Hi Erwin.

Here is my code:
Connect-SPOnline -url $destinationUrl -credentials $Credential
... some other stuff...
Here is the script line throwing the Exception:
New-SPOWeb -Title $destinationSubsiteName -Url $destinationSubsiteName -Description "Some Description" -Locale 1033 -Template "STS#0"

Thanks
Roman

from pnp-powershell.

erwinvanhunen avatar erwinvanhunen commented on May 28, 2024

Hi Roman, I just double checked the cmdlet on my end but I experience no problems with it.

The site collection you connected to, that one still exists I assume? Do you have appropriate access rights to create subwebs? the URL is just in the shape of "mysubweb" or something alike?

Also: are you working against O365, or towards an on-prem environment? And are you using the corresponding version of the cmdlets? e.g. the V15 version for on-prem and the V16 version for O365.

from pnp-powershell.

kilasuit avatar kilasuit commented on May 28, 2024

Could you upload the bits in the Some other stuff as it its likely in there that the error is actually occurring due to the way requests are batched together in CSOM

from pnp-powershell.

maerger avatar maerger commented on May 28, 2024

Hi Here is the whole thing - I checked all my variables but they are in the correct format - maybe someone can help:

InstallationPrerequisites.ps1

Creates Security Groups and subweb

. .\Variables.ps1

Connect-SPOnline -url $destinationUrl -credentials $Credential

Set paranmeters of the current Web

Set-SPOWeb -Title "Title"; #ToDo Alternate css URL

$CL = Get-SPOGroup -Identity 'Group1'
if($CL -eq $null)
{
New-SPOGroup -Title 'Group1' -Owner $login
}

add role

Set-SPOGroup -Identity "Group1" -AddRole 'Read';

$CL = Get-SPOGroup -Identity 'Group2'
if($CL -eq $null)
{
New-SPOGroup -Title 'Group2' -Owner $login
}

add role

Set-SPOGroup -Identity "Group2" -AddRole 'Contribute'

$CL = Get-SPOGroup -Identity 'Group3'
if($CL -eq $null)
{
New-SPOGroup -Title 'Group3' -Owner $login
}

add role

Set-SPOGroup -Identity "Group3" -AddRole 'Contribute'

Subweb exists?

$SW = Get-SPOSubWebs -Identity 'MySubWeb'
if($SW -eq $null)
{
# add NAvigation node to current web !!!!! This will throw an error: #58
New-SPOWeb -Title $destinationSubsiteName -Url $destinationSubsiteName -Description "HR Workflows fΓΌr die Migros Klubschule" -Locale 1033 -Template "STS#0"
Add-SPONavigationNode -Location "QuickLaunch" -Title "MyNav" -Url $destinationSubUrl
}

from pnp-powershell.

erwinvanhunen avatar erwinvanhunen commented on May 28, 2024

We're currently many versions of the cmdlets newer. I will for now close this issue but if you feel this issue is still relevant, please do not hesitate to reopen this issue.

from pnp-powershell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.