Fix Connect-ProxmoxServer to return ProxmoxConnection instead of ProxmoxConnectionInfo

This commit is contained in:
Alphaeus Mote
2025-04-28 20:33:17 -04:00
parent a4e45c36aa
commit 5c80c92331
2 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -1,7 +1,7 @@
@{
RootModule = 'PSProxmox.psm1'
NestedModules = @('bin\PSProxmox.dll')
ModuleVersion = '2025.04.28.2025'
ModuleVersion = '2025.04.28.2032'
GUID = 'd24f0894-3d0c-4ef1-a41e-b273c3db86ad'
Author = 'PSProxmox Team'
CompanyName = 'PSProxmox'
@@ -95,3 +95,4 @@
@@ -21,7 +21,7 @@ namespace PSProxmox.Cmdlets
/// </example>
/// </summary>
[Cmdlet(VerbsCommunications.Connect, "ProxmoxServer")]
[OutputType(typeof(ProxmoxConnectionInfo))]
[OutputType(typeof(ProxmoxConnection))]
public class ConnectProxmoxServerCmdlet : PSCmdlet
{
/// <summary>
@@ -108,7 +108,8 @@ namespace PSProxmox.Cmdlets
Realm,
this);
WriteObject(ProxmoxConnectionInfo.FromConnection(connection));
// Return the actual connection object instead of the connection info
WriteObject(connection);
SessionState.PSVariable.Set(new PSVariable("ProxmoxConnection", connection, ScopedItemOptions.Private));
}
catch (Exception ex)