In Powershell v2 I am trying to use DATA Sections contained in a psm1 file.
I can get it to work if I use the DATA Section within the main ps1 Script file:
## Code Write-Host $testDataSection ## Code DATA testDataSection {"This is a Test"}
But am I able to put the DATA Section in a psm1 File (or even osd1 file), and still use the Variable in a calling ps1 script? When I try this using ImportModule -name 'moduleContainingDATA.psm1', "Write-Host $testDataSection" doesn't output anything.
about_Data_Sections says Data Sections "lets you have separate string resource files for text, such as error messages and Help strings". I'm trying to do something similar with storing SQL Statements in an external file.