Skip to content

Instantly share code, notes, and snippets.

@chriskuech
Last active June 10, 2019 03:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chriskuech/7dba8d1103ab89469d46e242c5db96c1 to your computer and use it in GitHub Desktop.
Save chriskuech/7dba8d1103ab89469d46e242c5db96c1 to your computer and use it in GitHub Desktop.
$env:PSModulePath -split ":" `
| Get-ChildItem -Filter *.psd1 -Recurse `
| Import-PowerShellDataFile -ErrorAction SilentlyContinue `
| % {$_["RequiredModules"]} `
| % {@{Name = $_["ModuleName"]; RequiredVersion = $_["ModuleVersion"]}} `
| ? {-not (Get-Module @_ -ListAvailable)} `
| % {Install-Module @_}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment