Forum Discussion
Script from 2 csv - URL list and Folder list
- Aug 01, 2021
I took a quick sneak peek at your code and I don't think it will work.
Your code is structure like this
Foreach{
Variable
Function DoSomething{
Function DoSomethingMore{
}
}
}
This is not correct,
- Don't place the Function inside the Foreach, Foreach should be inside the function.
- If you need the Function to respone to a value, you need to set parameter to the function, something like DoSomething -FolderName $URL, and define the FolderName in the Function.
If the function are not needed, just remove them and keep the code of the function inside the foreach.
also you can use ISE and debug your code and you will see that the function block is not actually executed.
-------------------
Hope this help, if this answer help, please mark this answer as Best Reponse.
I took a quick sneak peek at your code and I don't think it will work.
Your code is structure like this
Foreach{
Variable
Function DoSomething{
Function DoSomethingMore{
}
}
}
This is not correct,
- Don't place the Function inside the Foreach, Foreach should be inside the function.
- If you need the Function to respone to a value, you need to set parameter to the function, something like DoSomething -FolderName $URL, and define the FolderName in the Function.
If the function are not needed, just remove them and keep the code of the function inside the foreach.
also you can use ISE and debug your code and you will see that the function block is not actually executed.
-------------------
Hope this help, if this answer help, please mark this answer as Best Reponse.
- rjackAug 03, 2021Brass Contributor
farismalaeb Thank you for pointing the issue. moved the foreach into the function and its working like clockwork.
Only problem is intermittently I get 429 but what can we do if server stops responding. or can we add something like 'wait until response' (if it exists)?
warning! I have zero knowledge in coding and scripts.