From 354269134aaf7972f7da1354f1165b49dba75e3d Mon Sep 17 00:00:00 2001
From: jbjohnso <jbjohnso@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
Date: Mon, 25 Mar 2013 13:57:16 +0000
Subject: [PATCH] Actually have a test case that will get to the permission
 denied phase

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@15644 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
---
 .../share/xcat/netboot/windows/xCAT.psm1       | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/xCAT-server/share/xcat/netboot/windows/xCAT.psm1 b/xCAT-server/share/xcat/netboot/windows/xCAT.psm1
index bd3194b6f..93de8736c 100644
--- a/xCAT-server/share/xcat/netboot/windows/xCAT.psm1
+++ b/xCAT-server/share/xcat/netboot/windows/xCAT.psm1
@@ -58,4 +58,22 @@ Function Connect-xCAT {
 	$script:xcatstream = $script:xcatconnection.GetStream()
 	$script:securexCATStream = New-Object System.Net.Security.SSLStream($script:xcatstream,$false,$script:verifycallback)
 	$script:securexCATStream.AuthenticateAsClient($mgtServerAltName)
+	$script:xcatwriter = New-Object System.IO.StreamWriter($script:securexCATStream)
+	$script:xcatreader = New-Object System.IO.StreamReader($script:securexCATStream)
+}
+
+Function Get-Power {
+	Param(
+		$nodeRange
+	)
+	$data = "<xcatrequest>`n`t<command>rpower</command>`n`t<arg>stat</arg>`n`t<noderange>$nodeRange</noderange>`n</xcatrequest>`n"
+	$script:xcatwriter.WriteLine($data)
+	$script:xcatwriter.Flush()
+	$response=""
+	$lastline=""
+	while (! $lastline.Contains("</xcatresponse>")) {
+		$lastline = $script:xcatreader.ReadLine()
+		$response = $response + $lastline
+	}
+	write-host $response
 }