Forum Discussion

rjack's avatar
rjack
Copper Contributor
Jul 29, 2021

Script from 2 csv - URL list and Folder list

Hello there!

I have 2 csv files. 

one has 82 rows with unique site address. like below

 

the other has 1314ish folder names with path. like below

Previously, I used to create 1000s of folder per site per script and now I have to create the same set of folders on 82 sites. so was trying to improvise the script by importing a csv and added 'for each'. the script works but skips all sites and goes to the last site in the list and creates the 1314 folders with correct permission. 

 

below is what I added to the script trying to trigger the loop.  Please help!

Would you need the full script? let me know, its 107 lines though. 🙂

 

 

$csvs= Import-CSV $csvfilepathsite
foreach ($row in $csvs)
{
$url = $row.siteurl
$GroupNames=$row.GroupNames

 

 

Resources