From 130d2b249449c2ab96941b9ea75c148bdee2f460 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 28 May 2013 15:05:07 +0000 Subject: [PATCH] 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 --- .../share/xcat/netboot/windows/xCAT.psm1 | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/xCAT-server/share/xcat/netboot/windows/xCAT.psm1 b/xCAT-server/share/xcat/netboot/windows/xCAT.psm1 index c7099e857..6a7666a37 100644 --- a/xCAT-server/share/xcat/netboot/windows/xCAT.psm1 +++ b/xCAT-server/share/xcat/netboot/windows/xCAT.psm1 @@ -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