# Include a SQL script file with a module

**URL:** <https://forums.powershell.org/t/include-a-sql-script-file-with-a-module/20894>\
**Category:** PowerShell Help\
**Created:** [November 11, 2022, 9:57am UTC](https://forums.powershell.org/t/include-a-sql-script-file-with-a-module/20894 "2022-11-11T09:57:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hawklance](https://avatars.discourse-cdn.com/v4/letter/h/6a8cbe/32.png) [@hawklance](https://forums.powershell.org/u/hawklance)\
**Post date:** [November 11, 2022, 9:57am UTC](https://forums.powershell.org/t/include-a-sql-script-file-with-a-module/20894/1 "2022-11-11T09:57:09Z")

</div>

I need to write a module that will perform a number of tasks on a SQL database. I know I can enter the SQL queries as strings but since some of them are longer scripts it would be much cleaner if I could include a sql script file to reference.

If I include the SQL script file in the module folder and include it in the FileList attribute of the module manifest, should the SQL script file be included when I publish the module to a local repository? If so, should functions in my module be able to reference the sql script when using Invoke-Sqlcmd with the -InputFile parameter?

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:16pm UTC](https://forums.powershell.org/t/include-a-sql-script-file-with-a-module/20894/2 "2024-05-16T20:16:25Z")

</div>


