From dd66c4427a996fa200969dd7c89bc7124e1c231e Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Wed, 22 May 2013 18:15:55 +0000 Subject: [PATCH] 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 --- .../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