qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Power shell with some problems.
@ 2023-02-20 14:04 Antonio Apostoliu
  0 siblings, 0 replies; only message in thread
From: Antonio Apostoliu @ 2023-02-20 14:04 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 3769 bytes --]

Hello

  You are so kind to look at next listing.

Where I wrong?

 

Best regards.

 

PS F:\step> $PSVersionTable

Name                           Value

----                           -----

PSVersion                      7.3.2

PSEdition                      Core

GitCommitId                    7.3.2

OS                             Microsoft Windows 10.0.19045

Platform                       Win32NT

PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0.}

PSRemotingProtocolVersion      2.3

SerializationVersion           1.1.0.1

WSManStackVersion              3.0

PS F:\step>dir

    Directory: F:\step

Mode                 LastWriteTime         Length Name

----                 -------------         ------ ----

d----           2/10/2023 12:00 PM                qemu

-a---           2/20/2023  3:05 PM      369754112 d.qcow2

-a---           2/20/2023  2:48 PM           1263 reset_vm.ps1

-a---           2/20/2023  3:23 PM            552 start.bat

PS F:\step> type .\start.bat

@echo off

set portqmp=4444

set em64w=qemu-system-x86_64w.exe

set "arg_c1=-accel whpx -k us -m 952 -M q35 -smp 1 -no-reboot -no-shutdown
-nographic"

set "arg_c2=-parallel none -serial none -rtc base=localtime,clock=host"

set "arg_c=%arg_c1% %arg_c2%"

set "arg_m=%arg_c% -nic user"

set "arg_u=-qmp tcp:localhost:%portqmp%,server,wait=off"

set "arg=%arg_m% %arg_u%"

for %%i in ("%~dp0.") do SET "mypath=%%~fi"

set "subdirector_qemu=qemu"

set "locatie_qemu=%mypath%\%subdirector_qemu%"

set "qm=%locatie_qemu%\%em64w%"

start "" %qm%  -hda d.qcow2 %arg%

PS F:\step> type .\reset_vm.ps1

$LoginParameters1 = @{

    Uri             = 'http://localhost:4444'

    SessionVariable = 'Session'

    Method          = 'POST'

    ContentType     = "application/json"

    Body            = @{

          "execute"= "qmp_capabilities"

        }

}

$LoginParameters2 = @{

    Method          = 'POST'

    ContentType     = "application/json"

    Body            = @{

         "execute"= "send-key"

         "arguments"= @{

                      "keys"= @(

                                 @{

                                   "type" = "qcode"

                                    "data" = "ctrl"

                                  }

                                @{

                                   "type" = "qcode"

                                   "data" = "alt"

                                 },

                               @{

                                   "type" = "qcode"

                                   "data" = "delete"

                                }

                             )

                    }

        }

}

$LoginResponse = Invoke-WebRequest @LoginParameters1

$ProfileResponse = Invoke-WebRequest 'http://localhost:4444' -WebSession
$Session @LoginParameters2

PS F:\step> .\start.bat

PS F:\step> Start-Sleep -Seconds 60

PS F:\step> .\reset_vm.ps1

Invoke-WebRequest: F:\step\reset_vm.ps1:40

Line |

  40 |  $LoginResponse = Invoke-WebRequest @LoginParameters1

     |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

     | Received an invalid status line: '{"QMP": {"version": {"qemu":
{"micro": 0, "minor": 2, "major": 7},

     | "package": "v7.2.0-11948-ge6523b71fc-dirty"}, "capabilities":
["oob"]}}'.

Invoke-WebRequest: F:\step\reset_vm.ps1:41

Line |

  41 |  . eResponse = Invoke-WebRequest 'http://localhost:4444' -WebSession
$Se .

     |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

     | Received an invalid status line: '{"QMP": {"version": {"qemu":
{"micro": 0, "minor": 2, "major": 7},

     | "package": "v7.2.0-11948-ge6523b71fc-dirty"}, "capabilities":
["oob"]}}'.

PS F:\step>



-- 
This email has been checked for viruses by Avast antivirus software.
www.avast.com

[-- Attachment #2: Type: text/html, Size: 14680 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-20 14:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-20 14:04 Power shell with some problems Antonio Apostoliu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).