Creating the PSM1 PowerShell Module File
Expand the full completed source code for this lesson below:
GreetMe.psm1 Full Source Code
In this lesson, we're going to be writing our PowerShell module or PSM1 file. Now, in this particular instance, what we're going to do is define a couple variables at the top. So I'll just call this variables. We're going to import all private functions. Then we're going to import And export functions from the public folder, and we're going to do this dynamically.
Now I want to make a note about security. What we're going to do for development purposes is automatically import any PowerShell files that are in the new public or private folders. And what this means is if somebody gains access to your system and they put. A file in here, a PowerShell script that has malicious code.
Your function will automatically import and execute that. And you may think, you know, that's not very good and it's really not. But I would also argue if somebody has permission to create files and PowerShell scripts and place them on your file system, you're already in a lot of trouble. With that being said, the system that we're going to write that will automatically dot source all of these PowerShell scripts ca…
No comments yet. Add the first comment to start the discussion.