{"id":69379,"date":"2016-12-13T15:02:31","date_gmt":"2016-12-13T15:02:31","guid":{"rendered":"https:\/\/www.simple-talk.com\/?p=69379"},"modified":"2021-04-27T13:35:16","modified_gmt":"2021-04-27T13:35:16","slug":"managing-hyper-v-vms-using-powershell-direct","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/sysadmin\/powershell\/managing-hyper-v-vms-using-powershell-direct\/","title":{"rendered":"Managing Hyper-V VMs using PowerShell Direct"},"content":{"rendered":"<h1><strong>Overview<\/strong><\/h1>\n<p>When your network environment reaches the point where it can become complicated to manage your virtual machines, you can use PowerShell Direct to eliminate all the network constraints. PowerShell Direct lets you to manage your VMs whether or not you have network connectivity, just as long as your virtual machines are located on your Hyper-V host!<\/p>\n<h1>Introduction<\/h1>\n<p>Many of you have probably already experienced the awful moment when you modify a network setting on a virtual machine (VM) and suddenly all connectivity is lost to the VM. Up to now, you would then need to use the Hyper-V console to retrieve the VM. Now, with PowerShell Direct, this is no longer necessary. PowerShell allows you to access the virtual machine directly without using the network. This happened because Microsoft introduced a new feature called &#8220;<strong>PowerShell Direct<\/strong>&#8220;. As the name implies, PowerShell is now able to directly access the virtual machine. How? It does it by using the Virtual Machine Bus (VMBus).<\/p>\n<p>Here is the official definition of Microsoft:<\/p>\n<blockquote>\n<p><strong>VMBus<\/strong> \u2013 Channel-based communication mechanism used for inter-partition communication and device enumeration on systems with multiple active virtualized partitions. The VMBus is installed with Hyper-V Integration Services.<\/p>\n<\/blockquote>\n<p>More information about the Hyper-V architecture here: <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/cc768520(v=bts.10).aspx\">Hyper-V Architecture<\/a><\/p>\n<h2><strong>PowerShell Direct<\/strong><\/h2>\n<p>Since Windows PowerShell version 5, Microsoft has implemented a new way to directly manage your virtual machines without network connectivity. However, this new feature requires some prerequisites before it can be used:<\/p>\n<p>Before using PowerShell Direct,<\/p>\n<ul>\n<li>The virtual machine must be running locally on the Hyper-V host and must be started.<\/li>\n<li>You must be logged into the host computer as a Hyper-V administrator.<\/li>\n<li>You must supply valid user credentials for the virtual machine.<\/li>\n<li>The host operating system and the virtual machine must be running Windows 10 or Windows Server 2016.<\/li>\n<li>Local installation of the guest systems is necessary.<\/li>\n<\/ul>\n<p>For those who do not perceive the big advantage of this feature, compare this to a management interface directly connected to your VMs. Think of the physical management interfaces you use on physical servers such as:<\/p>\n<ul>\n<li>HPE iLO<\/li>\n<li>Dell iDRAC<\/li>\n<\/ul>\n<p>Microsoft has developed PowerShell Direct to make life easier for the Hyper-V administrators in managing and configuring VMs.<\/p>\n<h3><strong>PowerShell Direct in action<\/strong><\/h3>\n<p>Before PowerShell Direct, what were the different methods of accessing a virtual machine?<\/p>\n<ul>\n<li><strong>Remote PowerShell<\/strong> : This method requires to modify some settings in your firewall configuration.<\/li>\n<li><strong>Remote Desktop<\/strong> : You must allow some users as &#8220;Remote Users&#8221; and open the TCP port 3389 on Windows Firewall.<\/li>\n<li><strong>VMConnect <\/strong>: The default management tool is used by default for accessing a VM. This is very useful but it does not automate your tasks.<\/li>\n<\/ul>\n<p>The first two methods, Remote PowerShell and Remote desktop, require network connectivity because you use the IP address of the VM or its DNS name to connect to the VM.<\/p>\n<p>PowerShell Direct combines these three methods to provide continuous, automated access to your virtual machines.<\/p>\n<p>PowerShell Direct therefore relies on the VMBus concept, a Hyper-V internal mechanism that provides a communication channel between the host and the VM. VMBus accesses the VMs using two parameters:<\/p>\n<ul>\n<li>The virtual machine name<\/li>\n<li>The VM Id<\/li>\n<\/ul>\n<p>The big advantage of PowerShell Direct is that it uses PowerShell interactive sessions allowing more flexibility and more tasks automation.<\/p>\n<h3><strong>What is the syntax of PowerShell Direct?<\/strong><\/h3>\n<p>Basically, this is the same syntax as a PowerShell session, with the only difference that the <strong>-VMName<\/strong> parameter is used instead of <strong>\u2013ComputerName<\/strong> parameter:<\/p>\n<pre class=\"theme:powershell-output lang:ps decode:true\">PS &gt; Enter-PSSession -VMName VM01<\/pre>\n<p>Or<\/p>\n<pre class=\"crayon:false\" style=\"color: white; font-family: 'Lucida Console', 'Courier New', Courier, monospace; font-size: 11px; line-height: 130%; padding: 8px; background: #1F3864; margin: 4px 0in 4px 0px;\"> Enter-PSSession \u2013VMId 31d787fe-02cd-4363-b50b-16bc8243fc77<\/pre>\n<p>This method allows you to log on to the VM and thus run several commands. Results are displayed in your PowerShell console. If you want to run a single command without opening an interactive session on the VM, you must use the <strong>Invoke-Command<\/strong> cmdlet:<\/p>\n<pre class=\"crayon:false\" style=\"color: white; font-family: 'Lucida Console', 'Courier New', Courier, monospace; font-size: 11px; line-height: 130%; padding: 8px; background: #1F3864; margin: 4px 0in 4px 0px;\">PS &gt; Invoke-Command -VMName VM01 -ScriptBlock { commands }<\/pre>\n<p>And finally, if you have a script that is located on your Hyper-V host and you want to run it in the VM, use the following command:<\/p>\n<pre class=\"crayon:false\" style=\"color: white; font-family: 'Lucida Console', 'Courier New', Courier, monospace; font-size: 11px; line-height: 130%; padding: 8px; background: #1F3864; margin: 4px 0in 4px 0px;\">PS &gt; Invoke-Command -VMName VM01 -FilePath 'C:\\scripts\\MyScript.ps1'<\/pre>\n<p>The <strong>Get-VM<\/strong> cmdlet will show you all the information you need to connect to your VM:<\/p>\n<pre class=\"theme:powershell-output lang:ps decode:true\">PS &gt; Get-VM | Select -Property Name, VMid\r\n\r\nName        VMId\r\n----        ----\r\nVM01        31d787fe-02cd-4363-b50b-16bc8243fc77\r\n<\/pre>\n<p>It is possible to enter your credentials in order to reuse them easily:<\/p>\n<pre class=\"crayon:false\" style=\"color: white; font-family: 'Lucida Console', 'Courier New', Courier, monospace; font-size: 11px; line-height: 130%; padding: 8px; background: #1F3864; margin: 4px 0in 4px 0px;\">PS &gt; $cred = Get-Credential\r\nPS &gt; Enter-PSSession -VMGuid\u00a031d787fe-02cd-4363-b50b-16bc8243fc77 -Credential $cred<\/pre>\n<p>Here is a full example of how to use PowerShell Direct.<\/p>\n<h4><strong>First step<\/strong><\/h4>\n<p>Identify the virtual machine and its name using the &#8220;<strong>Get-VM<\/strong>&#8221; cmdlet. Here, the name of the VM is &#8220;<strong>SQL011<\/strong>&#8220;, this one is started and version 8.0 indicates to me that it is compatible with PowerShell Direct:<\/p>\n<pre class=\"crayon:false\" style=\"color: white; font-family: 'Lucida Console', 'Courier New', Courier, monospace; font-size: 11px; line-height: 130%; padding: 8px; background: #1F3864; margin: 4px 0in 4px 0px;\">PS C:\\Users\\Administrator&gt; get-vm\r\n\r\nName      State   CPUUsage(%) MemoryAssigned(M) Uptime               Status              Version\r\n----      -----   ----------- ----------------- ------               ------              -------\r\nIIS19     Running 0           4096\t\t  15.08:20:51.4370000  Operating normally  5.0\r\n<span style=\"color: red; background-color: #ffff00;\">SQL011    Running<\/span> 0           8192\t\t  5.02:00:22.2520000   Operating normally <span style=\"color: red; background-color: #ffff00;\"> 8.0<\/span>\r\nSQL061    Running 0           8192\t\t  5.02:00:22.2520000   Operating normally  8.0\r\n<\/pre>\n<p>Then check the host on which the VM is running. Check also the &#8220;Guest Services&#8221; option:<\/p>\n<pre class=\"crayon:false\" style=\"color: white; font-family: 'Lucida Console', 'Courier New', Courier, monospace; font-size: 11px; line-height: 130%; padding: 8px; background: #1F3864; margin: 4px 0in 4px 0px;\">PS C:\\Users\\Administrator &gt; Get-VM SQL011 | select computername, VMIntegrationService\r\n\r\nComputerName VMIntegrationService\r\n------------ --------------------\r\nHypVServer01 {Guest Service Interface, Heartbeat,...}\r\n<\/pre>\n<p>\u2018<em>Guest services\u2019<\/em> is mandatory in order to copy files between hypervisor and VM. (We will see an example later in this article). If the \u2018<em>Guest Services\u2019<\/em> option is not active, it can be enabled via PowerShell:<\/p>\n<pre class=\"crayon:false\" style=\"color: white; font-family: 'Lucida Console', 'Courier New', Courier, monospace; font-size: 11px; line-height: 130%; padding: 8px; background: #1F3864; margin: 4px 0in 4px 0px;\">PS &gt; Enable-VMIntegrationService -VMName \"SQL011\" -Name \"Guest Service Interface\"<\/pre>\n<p>Now, open a PowerShell console as an administrator on your host. In my case, the Hyper-V host is \u201cHypVServer01\u201d.<\/p>\n<h4><strong>Second step<\/strong><\/h4>\n<p>Open a PowerShell session with your credentials via the <strong>Enter-PSSession<\/strong> cmdlet<\/p>\n<pre class=\"crayon:false\" style=\"color: white; font-family: 'Lucida Console', 'Courier New', Courier, monospace; font-size: 11px; line-height: 130%; padding: 8px; background: #1F3864; margin: 4px 0in 4px 0px;\">PS C:\\Users\\Administrator&gt; $cred = Get-Credential\r\n\r\ncmdlet Get-Credential at command pipeline position 1\r\nSupply values for the following parameters:\r\nCredential\r\nPS C:\\Users\\Administrator&gt; Enter-PSSession -VMName SQL011 -Credential $cred\r\n<span style=\"color: red; background-color: #ffff00;\">[SQL011]:<\/span> PS C:\\Users\\admin\\Documents&gt; \r\n<\/pre>\n<p>In this example, the session was successfully established via PowerShell Direct on the VM named \u201cSQL011\u201d. PowerShell therefore used the VMBus to join the VM.<\/p>\n<h4><strong>Third step<\/strong><\/h4>\n<p>To verify this, I display the virtual machine network adapter state using the <strong>Get-NetAdapter<\/strong> cmdlet:<\/p>\n<pre class=\"crayon:false\" style=\"color: white; font-family: 'Lucida Console', 'Courier New', Courier, monospace; font-size: 11px; line-height: 130%; padding: 8px; background: #1F3864; margin: 4px 0in 4px 0px;\">[SQL011]: PS C:\\Users\\admin\\Documents&gt; Get-NetAdapter\r\n\r\nName       InterfaceDescription              ifIndex Status       MacAddress             LinkSpeed\r\n----       --------------------              ------- ------       ----------             ---------\r\nEthernet   Microsoft Hyper-V Network Adapter 3       <span style=\"color: red; background-color: #ffff00;\">Disabled <\/span>    00-1D-D8-B6-4C-04      20 Gbps\r\n<\/pre>\n<p>This one is disconnected so I have no network connectivity on the VM.<\/p>\n<h4><strong>Fourth step<\/strong><\/h4>\n<p>Now I can type the PowerShell commands I want (Get-Service, Restart-Computer, \u2026):<\/p>\n<pre class=\"crayon:false\" style=\"color: white; font-family: 'Lucida Console', 'Courier New', Courier, monospace; font-size: 11px; line-height: 130%; padding: 8px; background: #1F3864; margin: 4px 0in 4px 0px;\">[SQL011]: PS C:\\Users\\admin\\Documents&gt; Get-Service\r\n\r\nStatus   Name               DisplayName\r\n------   ----               -----------\r\nStopped  AJRouter           AllJoyn Router Service\r\nStopped  ALG                Application Layer Gateway Service\r\nRunning  AppIDSvc           Application Identity\r\nStopped  Appinfo            Application Information\r\nStopped  AppMgmt            Application Management\r\nStopped  AppReadiness       App Readiness\r\nStopped  AppVClient         Microsoft App-V Client\r\n<\/pre>\n<p>In parallel, I can try to access the VM via PowerShell Remoting, but I get an error. PowerShell can\u2019t connect to the VM because the network adapter is disabled.<\/p>\n<pre class=\"crayon:false\" style=\"color: white; font-family: 'Lucida Console', 'Courier New', Courier, monospace; font-size: 11px; line-height: 130%; padding: 8px; background: #1F3864; margin: 4px 0in 4px 0px;\">PS C:\\Users\\admin&gt; Enter-PSSession -ComputerName SQL011 \r\n<span style=\"color: red;\">Enter-PSSession : Connecting to remote server SQL011 failed with \r\nthe following error message : WinRM cannot \r\ncomplete the operation. Verify that the specified computer name is \r\nvalid, that the computer is <span style=\"background-color: #ffff00;\">accessible over the<\/span> \r\n<span style=\"background-color: #ffff00;\">network<\/span>, and that a firewall exception for the WinRM service is \r\nenabled and allows access from this computer. By \r\ndefault, the WinRM firewall exception for public profiles limits \r\naccess to remote computers within the same local \r\nsubnet. For more information, see the about_Remote_Troubleshooting Help topic. \r\nAt line:1 char:1 \r\n+ Enter-PSSession -ComputerName SQL011 \r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \r\n\u00a0 \u00a0 + CategoryInfo\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 : InvalidArgument: (SQL011:String) \r\n[Enter-PSSession], PSRemotingTransportException \r\n\u00a0 \u00a0 + FullyQualifiedErrorId : CreateRemoteRunspaceFailed<\/span><\/pre>\n<h3><strong>Imagine what you could do with PowerShell Direct <\/strong><\/h3>\n<p>You could also copy files from your Host to your VM without any network access. So there is no need to create a shared folder on the VM, then assign the permissions on this folder. From now on, a simple PowerShell command and your file will be copied!<\/p>\n<p>Imagine that we have a script located on the Hyper-V host in the &#8220;C:\\Scripts\\&#8221; directory:<\/p>\n<pre class=\"crayon:false\" style=\"color: white; font-family: 'Lucida Console', 'Courier New', Courier, monospace; font-size: 11px; line-height: 130%; padding: 8px; background: #1F3864; margin: 4px 0in 4px 0px;\">PS &gt; $Session = New-PSSession -VMName SQL011 -Credential $cred \r\nPS &gt; Copy-Item <span style=\"color: red; background-color: #ffff00;\">-ToSession<\/span> $Session -path C:\\Scripts\\MyScript.ps1 -Destination C:\\ \r\nPS &gt; Enter-PSSession \u2013VMName SQL011 -Credential $cred \r\n[SQL011]: PS C:\\Users\\Admin\\Documents&gt; cd c:\\ \r\n[SQL011]: PS C:\\&gt; gci \r\n\r\n\u00a0 \u00a0 Directory: C:\\ \r\n\r\nMode\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LastWriteTime\u00a0 \u00a0 \u00a0 \u00a0 \u00a0Length Name \r\n----\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 -------------\u00a0 \u00a0 \u00a0 \u00a0 \u00a0------ ---- \r\nd-----\u00a0 \u00a0 \u00a0 \u00a0 9\/12\/2016\u00a0 \u00a01:34 PM\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Logs \r\nd-----\u00a0 \u00a0 \u00a0 \u00a0 7\/16\/2016\u00a0 \u00a03:23 PM\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 PerfLogs \r\nd-r---\u00a0 \u00a0 \u00a0 \u00a011\/28\/2016\u00a0 \u00a04:45 PM\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Program Files \r\nd-----\u00a0 \u00a0 \u00a0 \u00a011\/28\/2016\u00a0 10:00 PM\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Program Files (x86) \r\nd-r---\u00a0 \u00a0 \u00a0 \u00a011\/28\/2016\u00a0 \u00a04:55 PM\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Users \r\nd-----\u00a0 \u00a0 \u00a0 \u00a011\/29\/2016\u00a0 \u00a06:03 PM\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Windows \r\n-a----\u00a0 \u00a0 \u00a0 \u00a0 12\/3\/2016\u00a0 \u00a07:40 PM\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1 <span style=\"color: red; background-color: #ffff00;\">MyScript.ps1<\/span><\/pre>\n<p>You must first create a PowerShell session and then copy the file using the <strong>Copy-Item<\/strong> cmdlet followed by the &#8211;<strong>ToSession<\/strong> parameter. Then I can list the contents of the directory and notice that the script is copied well.<\/p>\n<h2><strong>PowerShell Direct and DSC<\/strong><\/h2>\n<p>I can also use PowerShell Direct to push DSC configurations very easily and without network connectivity. In this example, I set the DSC Local Configuration Manager of the VM to allow reboot, auto correct the config, and then verify that settings are applied using the <strong>Get-DSCLocalConfigurationManager<\/strong> cmdlet:<\/p>\n<pre class=\"crayon:false\" style=\"color: white; font-family: 'Lucida Console', 'Courier New', Courier, monospace; font-size: 11px; line-height: 130%; padding: 8px; background: #1F3864; margin: 4px 0in 4px 0px;\">PS &gt; Invoke-Command -VMName SQL011 -ScriptBlock {\r\n    configuration LCMConfiguration {\r\n        Node localhost {\r\n            LocalConfigurationManager\r\n\t     {\r\n\t         ConfigurationMode = 'ApplyAndAutoCorrect'\r\n\t         RebootNodeIfNeeded = $true\r\n                RefreshFrequencyMins = 20\r\n\t     }\r\n        }\r\n    }\r\n\r\n    LCMConfiguration -OutputPath C:\\Scripts\\DSC\r\n    Set-DscLocalConfigurationManager -Path C:\\Scripts\\DSC\r\n    Get-DSCLocalConfigurationManager\r\n} -Credential $cred\r\n<\/pre>\n<p>More information about Desired State Configuration: https:\/\/www.simple-talk.com\/sysadmin\/powershell\/powershell-desired-state-configuration-the-basics\/<\/p>\n<p>You will understand that this new feature has been introduced to simplify your daily tasks.<\/p>\n<h3><strong>How PowerShell Direct works in Hyper-V cluster?<\/strong><\/h3>\n<p>The idea is simple; you need to be logged on to the node that hosts the virtual machine that you want to manage. In the following example, if I want to reach the VM01 virtual machine that is located on \u201cnode 2\u201d, then I need to connect locally to \u201cnode 2\u201d to use the PowerShell Direct feature. Use the &#8220;<strong>Get-VM<\/strong>&#8221; cmdlet to verify this.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"991\" height=\"544\" class=\"wp-image-69380\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2016\/12\/word-image-15.png\" \/><\/p>\n<h3><strong>PowerShell Direct vs VMConnect<\/strong><\/h3>\n<p>Some of you will surely wonder about the utility of PowerShell Direct despite this article. You will probably wonder what the difference there is between<\/p>\n<ul>\n<li>Connecting to the Hyper-V host and then using PowerShell Direct to access the VM.<\/li>\n<li>Opening the &#8220;Hyper-V Manager&#8221; console and then using \u201cVMConnect\u201d to run your PowerShell command lines in the VM.<\/li>\n<\/ul>\n<p>I grant you, the gain of time is not obvious. But imagine if you could create a shortcut on your desktop giving you instant access to the VM? By reading an article on the TechNet website, I found this script which is very simple and that will be very useful to you.<\/p>\n<p>The idea is to create a first PowerShell session on your Hyper-V host, and when it is established, a second session will be created to your VM using this time PowerShell Direct:<\/p>\n<pre class=\"crayon:false\" style=\"color: white; font-family: 'Lucida Console', 'Courier New', Courier, monospace; font-size: 11px; line-height: 130%; padding: 8px; background: #1F3864; margin: 4px 0in 4px 0px;\">$VM = \"VM01\" \r\n$HypVServer = \"HyperV.domain.local\" \r\n$cred = Get-Credential \r\n$Session = New-PSSession -ComputerName $HypVServer -Credential $cred \r\nInvoke-command -Session $Session {Enter-PSSession -VMName $using:VM -credential $using:cred} \r\nEnter-PSSession $Session<\/pre>\n<p>Then, you simply create a shortcut on your desktop that will execute this:<\/p>\n<pre class=\"crayon:false\" style=\"color: white; font-family: 'Lucida Console', 'Courier New', Courier, monospace; font-size: 11px; line-height: 130%; padding: 8px; background: #1F3864; margin: 4px 0in 4px 0px;\">PS &gt; Powershell.exe -NoExit -File C:\\Users\\%Username%\\Desktop\\PSDirectToVM01.ps1<\/pre>\n<p>By double clicking on this shortcut, you will have to enter your credentials in order to connect to the VM. You access your host via the network, and then you use VMBus to connect to your VM.<\/p>\n<h3><strong>To go Further With Nano Server<\/strong><\/h3>\n<p>To go even further in this line of reasoning, PowerShell Direct takes centre stage if you want to manage a Nano server.<\/p>\n<p>With Windows Nano Server, Microsoft imposes a new way to manage the OS which must be done remotely. With this OS, remote management is driven by PowerShell scripts rather than by more conventional management tools such as the Remote Desktop Connection tool.<\/p>\n<p>To date, the difficulty that sysadmins face when managing Nano Server is that it has no graphical user interface. PowerShell Direct fixes this problem by allowing a simplified Nano Server operation from end-to-end. As soon as you deploy it, you can configure it without any network connectivity, so you will never, in theory, ever need to use the \u201cVMConnect\u201d to manage a Nano Server:<\/p>\n<p><img decoding=\"async\" class=\"wp-image-69381\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2016\/12\/word-image-16.png\" width=\"703\" \/><\/p>\n<h1>Conclusion<\/h1>\n<p>We&#8217;ve seen in this article the new PowerShell Direct feature that allows you to interact with the virtual machines on the Hyper-V host. Access to these VMs no longer requires network access, which is a great help to Hyper-V administrators.<\/p>\n<p>I think this is an excellent tool. It goes without saying that one must remain cautious about the security and the management of the accesses. Why? Because it is now possible to access the virtual machines without authorization in the firewall of the virtual machine. Imagine a machine in DMZ area for which it is no longer necessary to open network ports in the firewall because you can connect to it directly via the Hyper-V host? That poses a question, doesn\u2019t it?<\/p>\n<p>That is why, to finish, I advise you study another cool feature released by Microsoft: Just Enough Administration which will be very useful in order to secure access to your VMs.<\/p>\n<p>The article is available at: <a href=\"https:\/\/www.simple-talk.com\/sysadmin\/powershell\/powershell-just-enough-administration\/\">PowerShell Just Enough Administration&#8217;<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Virtual machines are easier to manage via PowerShell  than with the the Hyper-V Manager console.  PowerShell Direct takes this further by allowing you to interact easily with the virtual machines on the Hyper-V host without needing network access. With Windows Nano Server, PowerShell Direct is an essential because this OS requires you to use remote management via PowerShell scripts.<br \/>\n&hellip;<\/p>\n","protected":false},"author":158223,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[143516,35],"tags":[5970],"coauthors":[6804],"class_list":["post-69379","post","type-post","status-publish","format-standard","hentry","category-database-devops","category-powershell","tag-devops"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/69379","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/158223"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=69379"}],"version-history":[{"count":7,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/69379\/revisions"}],"predecessor-version":[{"id":90731,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/69379\/revisions\/90731"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=69379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=69379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=69379"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=69379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}