-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUpdateNovaModuleTools.ps1
More file actions
24 lines (20 loc) · 1020 Bytes
/
Copy pathUpdateNovaModuleTools.ps1
File metadata and controls
24 lines (20 loc) · 1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function Update-NovaModuleTool {
[CmdletBinding(SupportsShouldProcess = $true)]
[Alias('Update-NovaModuleTools')]
param()
$workflowContext = Get-NovaModuleSelfUpdateWorkflowContext
$plan = $workflowContext.Plan
if (-not $plan.UpdateAvailable) {
return Complete-NovaModuleSelfUpdateResult -Plan $plan -ReleaseNotesUri $null
}
if ($plan.IsPrereleaseTarget -and -not (Confirm-NovaPrereleaseModuleUpdate -Cmdlet $PSCmdlet -CurrentVersion $plan.CurrentVersion -TargetVersion $plan.TargetVersion)) {
$plan.Cancelled = $true
return Complete-NovaModuleSelfUpdateResult -Plan $plan -ReleaseNotesUri $null
}
if (-not $PSCmdlet.ShouldProcess($plan.ModuleName, $workflowContext.Action)) {
return Complete-NovaModuleSelfUpdateResult -Plan $plan -ReleaseNotesUri $null
}
$result = Invoke-NovaModuleSelfUpdateWorkflow -WorkflowContext $workflowContext
Write-NovaModuleReleaseNotesLink -ReleaseNotesUri $result.ReleaseNotesUri
return $result
}