Add event log cmdlets to powershell

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@16400 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2013-05-22 18:15:55 +00:00
parent 2cb38161a8
commit dd66c4427a

View File

@ -180,6 +180,28 @@ Function ConnectxCAT {
$true
}
Function Clear-NodeEventlog {
Param(
[parameter(ValueFromPipeLine=$true)] $nodeRange
)
$pipednr=@($input)
if ($pipednr) { $nodeRange = $pipednr }
$xcatrequest=@{'command'='reventlog';'noderange'=$nodeRange;'args'=@('clear')}
Send-xCATCommand($xcatrequest)
}
Function Get-NodeEventlog {
Param(
[parameter(ValueFromPipeLine=$true)] $nodeRange,
[parameter(ValueFromRemainingArguments=$true)] $eventCount
)
if (-not $eventCount) {
$eventCount = "all"
}
$pipednr=@($input)
if ($pipednr) { $nodeRange = $pipednr }
$xcatrequest=@{'command'='reventlog';'noderange'=$nodeRange;'args'=@($eventCount)}
Send-xCATCommand($xcatrequest)
}
Function Get-NodeInventory {
Param(
[parameter(ValueFromPipeLine=$true)] $nodeRange,
@ -439,6 +461,7 @@ Function NewxCATDataFromXmlElement {
$myobj.PSObject.TypeNames.Insert(0,$objname)
return $myobj
}
New-Alias -name reventlog -value Get-NodeEventlog
New-Alias -name rsetboot -value Set-NodeBoot
New-Alias -name nodeset -value Set-NodeDeploy
New-Alias -name rpower -value Set-NodePower