Whats the correct format of the New-SPWeb
command when using the UseParentTopNav
argument?
I'm trying to add a new site, I've tried passing in the following
New-SPWeb -url "http://server" -Template "STS#0" -Name "test99" -Description "test99" -UseParentTopNav 1
and
New-SPWeb -url "http://server" -Template "STS#0" -Name "test99" -Description "test99" -UseParentTopNav true
they both give error message
New-SPWeb : A positional parameter cannot be found that accepts argument '1'.
At line:2 char:11
+ New-SPWeb <<<< -url "http:/server" -Template "STS#0" -Name "test99" -Description "test99" -UseParentTopNav 1
+ CategoryInfo : InvalidArgument: (:) [New-SPWeb], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.SharePoint.PowerShell.SPCmdletNewWeb
and
New-SPWeb : A positional parameter cannot be found that accepts argument 'true'.
At line:3 char:11
+ New-SPWeb <<<< -url "http://onlm45005wkhxn1:33333" -Template "STS#0" -Name "test99" -Description "test99" -UseParentTopNav true
+ CategoryInfo : InvalidArgument: (:) [New-SPWeb], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.SharePoint.PowerShell.SPCmdletNewWeb
If I run the help command
get-help New-SPWeb -full
it gives me this information.
-UseParentTopNav <SwitchParameter> Specifies that the same top-level navigation bar as the parent site is to be used for this site. Required? false Position? Named Default value Accept pipeline input? False Accept wildcard characters? false
What format should the <SwitchParameter>
be?