Build PSProxmox.dll and fix compilation issues

This commit is contained in:
Alphaeus Mote
2025-04-28 14:35:22 -04:00
parent 2385442c83
commit 7889ba2f97
9 changed files with 244 additions and 12 deletions
+8 -2
View File
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using PSProxmox.Client;
using PSProxmox.Session;
@@ -14,7 +15,7 @@ namespace PSProxmox.Cmdlets
/// <code>Leave-ProxmoxCluster -Connection $connection -Force</code>
/// </example>
/// </summary>
[Cmdlet(VerbsCommon.Leave, "ProxmoxCluster", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.High)]
[Cmdlet("Leave", "ProxmoxCluster", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.High)]
public class LeaveProxmoxClusterCmdlet : PSCmdlet
{
/// <summary>
@@ -53,7 +54,12 @@ namespace PSProxmox.Cmdlets
}
WriteVerbose($"Removing node {Connection.Server} from cluster");
client.Delete("cluster/leave", parameters);
string queryString = "";
if (parameters.Count > 0)
{
queryString = "?" + string.Join("&", parameters.Select(p => $"{p.Key}={p.Value}"));
}
client.Delete($"cluster/leave{queryString}");
WriteVerbose($"Node {Connection.Server} removed from cluster");
}
+2 -2
View File
@@ -73,7 +73,7 @@ namespace PSProxmox.Cmdlets
/// <para type="description">Additional parameters for the storage.</para>
/// </summary>
[Parameter(Mandatory = false)]
public Hashtable AdditionalParameters { get; set; }
public Dictionary<string, string> AdditionalParameters { get; set; }
/// <summary>
/// Processes the cmdlet.
@@ -119,7 +119,7 @@ namespace PSProxmox.Cmdlets
}
// Create the storage
string createResponse = client.Post("storage", parameters);
client.Post("storage", parameters);
// Get the created storage
string storageResponse = client.Get($"storage/{Name}");