mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Make Restore-PSModule -Name parameter a [string[]]
This commit is contained in:
1 parent
1fff6760b6
commit
5ff63e50b7
1 file changed
+17
-15
+17
-15
@@ -406,8 +406,7 @@ cmd.exe /C cd /d "$location" "&" "$($vcVarsPath)\vcvarsall.bat" "$NativeHostArch
|
||||
# so we need to get its parent directory
|
||||
$publishPath = Split-Path $Options.Output -Parent
|
||||
log "Restore PowerShell modules to $publishPath"
|
||||
Restore-PSModule -Name PackageManagement -Destination (Join-Path -Path $publishPath -ChildPath "Modules")
|
||||
Restore-PSModule -Name PowerShellGet -Destination (Join-Path -Path $publishPath -ChildPath "Modules")
|
||||
Restore-PSModule -Name @('PackageManagement','PowerShellGet') -Destination (Join-Path -Path $publishPath -ChildPath "Modules")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2556,7 +2555,7 @@ function Restore-PSModule
|
||||
param(
|
||||
[Parameter(Mandatory=$true)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$Name,
|
||||
[string[]]$Name,
|
||||
|
||||
[Parameter(Mandatory=$true)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
@@ -2612,21 +2611,24 @@ function Restore-PSModule
|
||||
|
||||
log ("Name='{0}', Destination='{1}', Repository='{2}'" -f $Name, $Destination, $RepositoryName)
|
||||
|
||||
$command = @{
|
||||
Name=$Name
|
||||
Path = $Destination
|
||||
Repository =$RepositoryName
|
||||
}
|
||||
$Name | ForEach-Object {
|
||||
|
||||
if($RequiredVersion)
|
||||
{
|
||||
$command.Add("RequiredVersion", $RequiredVersion)
|
||||
$command = @{
|
||||
Name=$_
|
||||
Path = $Destination
|
||||
Repository =$RepositoryName
|
||||
}
|
||||
|
||||
if($RequiredVersion)
|
||||
{
|
||||
$command.Add("RequiredVersion", $RequiredVersion)
|
||||
}
|
||||
|
||||
# pull down the module
|
||||
log "running save-module $Name"
|
||||
PowerShellGet\Save-Module @command -Force -Verbose
|
||||
}
|
||||
|
||||
# pull down the module
|
||||
log "running save-module $Name"
|
||||
PowerShellGet\Save-Module @command -Force -Verbose
|
||||
|
||||
# Clean up
|
||||
if($needRegister)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user