mirror of
https://github.com/Grace-Solutions/PSProxmox.git
synced 2026-08-13 08:36:55 +00:00
Build PSProxmox.dll and fix compilation issues
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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}");
|
||||
|
||||
Reference in New Issue
Block a user