How do I correctly perform includes in Powershell? I have this script:
& .\config.ps1
& .\scripts\functions.ps1
Write-Host -f yellow "Saving root site collection"
backupSiteCollection $appURL ($pathDIR + $filesDIR + "\" + $rootSiteCollectionFIL)
Write-Host -f yellow "Saving operation template site collection"
backupSiteCollection ($appURL + $operationTemplateURL) ($pathDIR + $filesDIR + "\" + $operationTemplateFIL)
Write-Host -f yellow "Saving operation template site collection"
backupSolutions $solutionsARY ($pathDIR + $filesDIR)
Write-Host -f yellow "Zipping deployment package"
.\bin\7za.exe a -tzip ".\deploymentPackages\deploymentPackage.zip" "..\deployment"
It actually executes config.ps1 and functions.ps1 (I have echo commands within)m, but it still doesn't recognize my functions:
...loading config.ps1
...loading functions.ps1
Saving root site collection
backupSiteCollection : The term 'backupSiteCollection' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included, verify that the path is correct and try again.