working on #742 - minor fixes

This commit is contained in:
Bernardo Damele 2014-06-30 18:18:14 +01:00
parent 563c73c4c7
commit aa076013a7

View File

@ -181,10 +181,14 @@ class Filesystem(GenericFilesystem):
#psString = "[System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String(%s)) > %s" % (encodedFileContent, dFile) #psString = "[System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String(%s)) > %s" % (encodedFileContent, dFile)
#psString = "[System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String(\"%s\")) | Out-File -Encoding \"ASCII\" %s" % (encodedFileContent, dFile) #psString = "[System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String(\"%s\")) | Out-File -Encoding \"ASCII\" %s" % (encodedFileContent, dFile)
psString = "[System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String(\"%s\")) > %s" % (encodedFileContent, dFile) psString = "[System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String(\"%s\")) > %s" % (encodedFileContent, dFile)
psString = psString.encode('utf-16le')
psString = base64encode(psString)
logger.debug("converting the base64-encoded file utilizing PowerShell") print "psString:", psString
commands = ("cd \"%s\"" % tmpPath, "powershell -EncodedCommand %s" % base64encode(psString)) logger.debug("executing the base64-encoded PowerShell command to write the file")
commands = ("cd \"%s\"" % tmpPath, "powershell -EncodedCommand %s" % psString)
complComm = " & ".join(command for command in commands) complComm = " & ".join(command for command in commands)
self.execCmd(complComm) self.execCmd(complComm)