Skip to content

Instantly share code, notes, and snippets.

@billkindle
Last active December 11, 2020 04:54
Show Gist options
  • Save billkindle/8121cfb8454e529c24e9e54cc5a6a47e to your computer and use it in GitHub Desktop.
Save billkindle/8121cfb8454e529c24e9e54cc5a6a47e to your computer and use it in GitHub Desktop.
I use this small script to occasionally update my most used modules so I can copy them to systems I manage or to a network share.
# These are moudles that I need to routinely save from the PowerShell Gallery
$modules = @("Pester","dbatools","dbachecks","psTrustedHosts","PoshWSUS","PSWindowsUpdate","PSDecode","PoshRSJob","PSFramework",
"ScheduledJobTools","WindowsCompatibility","ImportExcel","BurntToast","Invoke-CommandAs","PoshEvents","psbbix","UniversalDashboard.Community")
$path = Read-Host -Prompt 'Please enter the full path to which you want to save common modules:'
Foreach ($module in $modules) {
Save-Module -Name $module -Path $path -AcceptLicense -Force
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment