Struggling to read files and services running on an hyper-v VM

Welcome Forums General PowerShell Q&A Struggling to read files and services running on an hyper-v VM

  • This topic has 3 replies, 3 voices, and was last updated 9 months ago by
    Moderator
    .
Viewing 3 reply threads
  • Author
    Posts
    • #194393
      Participant
      Topics: 1
      Replies: 1
      Points: 14
      Rank: Member

      I am automating an hyper-v vm from outside of the vm

      In my scripts I have a checkpoint applied, running the VM and waiting for it to become stable, then copying and running an exe to install an application

      After installing the app I want to check the files are installed and the services are running

      To do the the latter, I am trying the following

      This is currently returning

      Does anyone know what the correct syntax or code I should be using please?

      Thanks

       

       

    • #194429
      Participant
      Topics: 13
      Replies: 1753
      Points: 3,136
      Helping Hand
      Rank: Community Hero

      Look at your commands. There is no ‘VMName’ parameter, it should be -ComputerName

    • #194891
      Participant
      Topics: 1
      Replies: 1
      Points: 14
      Rank: Member

      Thank you!

    • #194918
      Moderator
      Topics: 5
      Replies: 237
      Points: 1,320
      Helping Hand
      Rank: Community Hero

      Please remove -VMName parameter from the Invoke-Command CmdLet, you can provide either -VMName or -Session but not both.

      Both New-PSSession and Invoke-Command supports -VMName parameter. From Windows Server 2016/Windows 10 onwards it supports PowerShell Direct to manage the Hyper-V VMs directly from the Host itself.

      Thank you.

Viewing 3 reply threads
  • The topic ‘Struggling to read files and services running on an hyper-v VM’ is closed to new replies.