Hi,
You can use Invoke-NcSystemApi if there is no CmdLet. Here's an example:
Param(
[Parameter(Mandatory = $True, HelpMessage = "The ONTAP Cluster Hostname, FQDN or IP Address")]
[String]$Cluster,
[Parameter(Mandatory = $True, HelpMessage = "The Aggregate Name")]
[String]$Aggregate,
[Parameter(Mandatory = $True, HelpMessage = "The Vserver Name")]
[String]$Vserver,
[Parameter(Mandatory = $True, HelpMessage = "The Volume Name")]
[String]$Volume,
[Parameter(Mandatory = $True, HelpMessage = "The Volume Size in GigaBytes")]
[String]$SizeGB,
[Parameter(Mandatory = $True, HelpMessage = "The Origin Vserver Name")]
[String]$OriginVserver,
[Parameter(Mandatory = $True, HelpMessage = "The Origin Volume Name")]
[String]$OriginVolume,
[Parameter(Mandatory = $True, HelpMessage = "The Credential to authenticate to the ONTAP cluster")]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]$Credential
)
#'------------------------------------------------------------------------------
#'Connect to the cluster.
#'------------------------------------------------------------------------------
Try{
Connect-NcController -Name $Cluster -ZapiCall -Credential $Credential -ErrorAction Stop
}Catch{
Write-Warning -Message $("Failed connecting to cluster ""$Cluster"". Error " + $_.Exception.Message)
Exit -1
}
#'------------------------------------------------------------------------------
#'Create a flexcache volume.
#'------------------------------------------------------------------------------
[Array]$command = $("set advanced;volume flexcache create -vserver $Vserver -volume $Volume -origin-volume $OriginVolume -size " + $($SizeGB + 'GB') + " -origin-vserver $OriginVserver -aggr-list $Aggregate")
Try{
$api = $("<system-cli><args><arg>" + ($command -join "</arg><arg>") + "</arg></args></system-cli>")
Write-Host $("Executed Command`: " + $([String]::Join(" ", $command)))
$response = Invoke-NcSystemApi -Request $api -ErrorAction Stop
}Catch{
Write-Warning -Message $("Failed Executing Command`: " + $([String]::Join(" ", $command)))
Break;
}
#'------------------------------------------------------------------------------
Hope that helps
/Matt
If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.