Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 27852

Problem with New-Website

$
0
0

I've written the following script to add websites stored in a directory structure that is as follows

d:\Websites\google.com\Site\ 

where \Site is the virtual root of the website.

Whenever I run the script, I get
New-Item : Index was outside the bounds of the array

And I don't remember how to get the stack trace to paste here but when I did it yesterday, it was a problem in the method GenerateSiteID or something similarly named.

$websiteDirs = Get-ChildItem -Path "d:\Websites"

foreach( $dir in $websiteDirs ) {    
    $webRoot = join-path $dir.FullName Site
    New-Website -name $dir.Name -physicalPath $webRoot -HostHeader $dir.Name
}

 


Viewing all articles
Browse latest Browse all 27852

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>