Release Notes

19 Automating Dell EMC PowerEdge Server Management by using iDRAC REST API with DMTF Redfish and Microsoft PowerShell
function Set-PowerControlREDFISH {
# Within the function, define the supported parameters, indicating which are
mandatory and which are optional.
param(
[Parameter(Mandatory=$True)]
[string]$idrac_ip,
[Parameter(Mandatory=$True)]
[string]$idrac_username,
[Parameter(Mandatory=$True)]
[string]$idrac_password,
[Parameter(Mandatory=$False)]
[string]$power_request_value,
[Parameter(Mandatory=$False)]
[string]$get_power_state_only
)
# Function to ignore SSL certs. If you don’t have a valid SSL certificate for the
iDRAC, pass in this function which will ignore SSL cert check.
function Ignore-SSLCertificates
{
$Provider = New-Object Microsoft.CSharp.CSharpCodeProvider
$Compiler = $Provider.CreateCompiler()
$Params = New-Object System.CodeDom.Compiler.CompilerParameters
$Params.GenerateExecutable = $false
$Params.GenerateInMemory = $true
$Params.IncludeDebugInformation = $false
$Params.ReferencedAssemblies.Add("System.DLL") > $null
$TASource=@'
namespace Local.ToolkitExtensions.Net.CertificatePolicy
{
public class TrustAll : System.Net.ICertificatePolicy
{
public bool CheckValidationResult(System.Net.ServicePoint
sp,System.Security.Cryptography.X509Certificates.X509Certificate cert,
System.Net.WebRequest req, int problem)
{
return true;
}
}
}
'@
$TAResults=$Provider.CompileAssemblyFromSource($Params,$TASource)
$TAAssembly=$TAResults.CompiledAssembly
$TrustAll =
$TAAssembly.CreateInstance("Local.ToolkitExtensions.Net.CertificatePolicy.TrustAl
l")
[System.Net.ServicePointManager]::CertificatePolicy = $TrustAll
}
Ignore-SSLCertificates