Skip to main content

Home/ PowerShell/ Group items matching "best-practices" in title, tags, annotations or url

Group items matching
in title, tags, annotations or url

Sort By: Relevance | Date Filter: All | Bookmarks | Topics Simple Middle
anonymous

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.
1 - 2 of 2
Showing 20 items per page