Skip to main content

Home/ PowerShell/ Group items tagged best-practices

Rss Feed Group items tagged

4More

Best Practices for Importing PowerShell Modules - 0 views

  • Importing Modules Is Messy
  • It hit me the other day that I should write an Import-Carbon.ps1 script which properly handles all the weird edge cases
  • Finally! One line of code to import a module. And, only one place to change if additional weird edge cases pop up.
  • ...1 more annotation...
  • When writing a module, always write and include a script that safely imports the module. I recommend using the above code as a template. If you're using a module that doesn't include a safe import scrpt, write one yourself. Test for a variable or function that is specific to the module.

Instadp blogs - 2 views

started by walexjalper78 on 17 Mar 23 no follow-up yet
1 - 3 of 3
Showing 20 items per page