Hi everyone, I’m new here and hope this is the proper place to post. I just created my first module, which I am considering publishing to the gallery, but I wanted some feedback on my code first.
The module is named SimpleSQLServer, and as the name might imply, it is a module for interacting with MS SQL Server databases for basic CRUD actions.
I’m not sure if the category you choose actually fits and I’m by no means not an SQL guy so I cannot say anything about your code or the module itself. But I wonder if the world really needs another SQL PowerShell module. If I search the PowerShell gallery for “SQL” I get more than 300 hits.
Does your module deliver something substancial different or better than the established ones? I’ve heard that for example the dbatools are well received in the community.
I could imagine that It could be even more revarding to contribute to an already established module than trying to create a completely new one from scratch.
Hey, thank you for replying! You’re probably right that contributing to an existing one might be the better option. I’ll be honest and say that creating this was more about building out my GitHub profile to aid in my current job hunt than building something new. But it is code I’ve created based on several years of experience, and I’d say that its difference is its simplicity.
But, I appreciate the reply, the advice, and the well wishes.
Good luck to you as well, and may you have a great weekend!
After a quick look over your module code, I have a couple suggestions.
I would consider using [ValidateScript] for parameter validations into instead of coding in the begin block.
I would suggest removing empty begin and end blocks. They add more code and hinder code readability, and don’t really serve any purpose.
To make your code pretty, I suggest using VSCode’s auto-formatting capabilities. It does a good job of improving readability and consistency.
Clean up general inconsistencies - like (Mandatory) vs (Mandatory = $true). Both are correct, so choose one and go with it always. I prefer (Mandatory) because less code. Keeping these sorts of things the same across all your code makes it look more professional.