Hi,
Trying to use a runbook in Azure Automation for creating and modifying sharepoint sites
An URL I construct using a static and a variable part when connecting to the newly created site works on desktop ISE but not in the runbook
New-PNPSite -type Teamsite -Title $SiteColTitle -Alias $SiteColName
Connect-PnPOnline -url -Site "https://fqdn/sites/$SiteColName" -Credentials $myCred
throws this error;
Connect-PnPOnline : A positional parameter cannot be found that accepts argument 'https://fqdn/sites/Test_003'.
At line:25 char:1
+ Connect-PnPOnline -url -Site "https://fqdn/sites/$Si ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Connect-PnPOnline], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,PnP.PowerShell.Commands.Base.ConnectOnline
I do see the new site in sharepoint admin active sites, so it is created, but connecting to it afterwards fails
When trying with the full URL it does work but I want to reuse the $SiteColName and not have to make a $SiteColURL as well...
does constructing an URL work differently in a runbook then in ISE on my desktop?
Thanks!
merry Xmas! :)