Closed lvanvugt closed 3 years ago
My bad
That piece of code inside the container is only used when building images or running containers without bccontainerhelper.
The same function exists in C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\
OK, did abandon the -myScript option and updated function GetTestToolkitApps in file C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\ [version] \HelperFunctions.ps1
Before
if (!$includeTestLibrariesOnly) {
# Add Tests
$apps += @(get-childitem -Path "C:\Applications\*.*" -recurse -filter "Microsoft_Tests-*.app") | Where-Object { $_ -notlike "*\Microsoft_Tests-TestLibraries.app" -and $_ -notlike "*\Microsoft_Tests-Marketing.app" -and $_ -notlike "*\Microsoft_Tests-SINGLESERVER.app" }
}
After
if (!$includeTestLibrariesOnly) {
# Add Tests
$apps += @(get-childitem -Path "C:\Applications\*.*" -recurse -filter "Microsoft_Tests-*.app") | Where-Object { $_ -notlike "*\Microsoft_Tests-TestLibraries.app" }
}
Ran my script (see above) again, but no difference.
I even added this line to GetTestToolkitApps to see if it was called:
Write-Host -ForegroundColor Yellow "GetTestToolkitApps"
Did not show, unfortunately.
Did you restart PowerShell?
Nope. Doing right now.
Yessss
So it does allow them to be deployed. Not technical issue. Now the question is whether I can run them. Will test that right now.
Tests-SINGLESERVER tests run without technical issues (625 successes - 103 failures) Tests-Marketing tests run without technical issues (679 successes - 12 failures)
-myScripts seems to work, but when used to replace the HelperFunctions.ps1 is operates only on this HelperFunctions.ps1 and not on HelperFunctions.ps1.
Issue Wanting to override the standard HelperFunctions.ps1 I have created my own version of it and have added a file reference to the -myScripts parameter of New-BCContainer; see following script. The purpose is to get the following two test apps deployed as these are excluded by the standard HelperFunctions.ps1, but are contained in the artefacts:
Even though my HelperFunctions.ps1 is copied to c:\run\my folder is seems not to be executed as these two extensions are not deployed. See below a zipped version of my HelperFunctions.ps1.
Reading your blog post NavContainerHelper – Overriding scripts in NAV containers did not show me what I might be doing wrong.
Should I be able to see whether it did execute my replacement script?
Scripts used to create container and cause the issue
Full output of scripts
My HelperFunctions.ps1 HelperFunctions.zip