Please address the following errors in the file AutoSPSourceBuilder.ps1

Topics: Feedback
Aug 14, 2015 at 3:16 PM
Hello,
Thank you for this project, please be aware that In running your latest version I have discovered two errors in your PS1 file.

The first issue produces an error message that "Cannot index into a null array.
At Y:\SP2013\AutoSPInstaller\AutoSPSourceBuilder\AutoSPSourceBuilder.ps1:518 ch"

The cause is actually on line 532 where you are currently calling $spCU.URL[0] needs to be changed to $spCU[0].Url


The second issue produces and error message that "Get-ChildItem : A parameter cannot be found that matches parameter name 'File'."

The cause is on line 228 where you are passing an empty parameter
ForEach ($item in (Get-ChildItem -File -Path $Path -Recurse -ErrorAction SilentlyContinue))

This needs to be changed to

ForEach ($item in (Get-ChildItem -Path $Path -Recurse -ErrorAction SilentlyContinue))


Once these changes are made the script executes normally.
Coordinator
Aug 14, 2015 at 7:18 PM
What OS are you running the script on, and what version of PowerShell ($host.Version) ?

Thanks,
Brian
Aug 17, 2015 at 2:40 PM
Edited Aug 17, 2015 at 2:41 PM
Good point;

Windows OS 7 Professional w/Service Pack 1
PowerShell Version

Major Minor Build Revision
2 0 -1 -1