Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ OperationType operation
if (options.PreRelease)
parameters.Add("-AllowPrerelease");

if (!package.OverridenOptions.PowerShell_DoNotSetScopeParameter)
// Update-Module (PowerShellGet) has no -Scope parameter; only Install-Module accepts it
if (operation is OperationType.Install && !package.OverridenOptions.PowerShell_DoNotSetScopeParameter)
{
if (
package.OverridenOptions.Scope == PackageScope.Global
Expand Down Expand Up @@ -66,6 +67,10 @@ package.OverridenOptions.Scope is null
}
);

// Windows PowerShell 5.x defaults to TLS 1.0/1.1, which the PowerShell Gallery rejects; force TLS 1.2 so gallery operations can connect under -NoProfile
if (operation is not OperationType.Uninstall)
parameters.Insert(0, "[Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12;");

return parameters;
}

Expand Down
12 changes: 12 additions & 0 deletions src/UniGetUI.PackageEngine.Operations/AbstractProcessOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,18 @@ protected override async Task<OperationVeredict> PerformOperation()
Line($" - Arguments: \"{process.StartInfo.Arguments.Trim()}\"", LineType.VerboseDetails);
Line($"Start Time: \"{DateTime.Now}\"", LineType.VerboseDetails);

// An empty FileName means elevation was required but no elevator (UniGetUI Elevator/GSudo) is available
if (string.IsNullOrWhiteSpace(process.StartInfo.FileName))
{
Line(
CoreTools.Translate(
"This operation requires administrator privileges, but the elevation tool could not be found. The operation cannot continue."
),
LineType.Error
);
return OperationVeredict.Failure;
}

if (_requiresUACCache)
{
_requiresUACCache = false;
Expand Down
Loading