Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (16 sloc) 598 Bytes
$ModulePath must not already contain the modules or this may fail
$ModulePath = 'D:\home\lib\PSModules'
New-Item -ItemType Directory -Path $ModulePath -Force | Out-Null
$NuGet = Get-PackageProvider -Name NuGet -ErrorAction SilentlyContinue
if($null -eq $NuGet)
Install-PackageProvider -Name NuGet -MinimumVersion -Force -Scope CurrentUser
"Saving modules to $ModulePath"
Save-Module Az -Path $ModulePath -Force
"Listing import commands for every module"
Get-ChildItem -Path $ModulePath -Include "*.psd1" -Recurse | ForEach-Object {
"Import-Module '$($_.FullName)'"
You can’t perform that action at this time.