Add event log cmdlets to powershell

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16435 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2013-05-28 15:05:07 +00:00
parent fb01e8e151
commit 130d2b2494

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